When i try to run the following hook:
cat > hook.tmpl << EOF
ARGUMENTS = "$TEMPLATE"
ARGUMENTS_STDIN = "yes"
COMMAND = "test.sh"
NAME = "test"
ON = "CUSTOM"
STATE = "ACTIVE"
LCM_STATE = "RUNNING"
REMOTE = "no"
RESOURCE = "VM"
TYPE = "state"
EOF
test.sh file:
#!/bin/bash
XPATH="/var/lib/one/remotes/datastore/xpath.rb --stdin"
TEMPLATE="$(cat)"
unset i j XPATH_ELEMENTS
while IFS= read -r -d '' element; do
XPATH_ELEMENTS[i++]="$element"
done < <($XPATH -b $TEMPLATE '/VM/ID')
VM_ID="${XPATH_ELEMENTS[j++]}"
I get this error:
onehook retry 1 -e 0
Wrong protocol specified. Only http or https allowed!
I’m guessing it may be related to this config in onehem-server.conf:
# :subscriber_endpoint to subscribe for OpenNebula events must match those in
# oned.conf
:subscriber_endpoint: 'tcp://localhost:2101'
# :replier_endpoint to send to oned hook execution results (reply to events) must
# match those in oned.conf
:replier_endpoint: 'tcp://localhost:2102'
oned.conf section:
HM_MAD = [
EXECUTABLE = "one_hm",
ARGUMENTS = "-p 2101 -l 2102 -b 127.0.0.1"]
I tried changing tcp to https but got the same error after restarting the opennenbula services, also tried changing localhost to 127.0.0.1 and same issue.
Running ubuntu 20.04 ONE versions 6.0.0.2