Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

vCenter alarm action script to start vRO workflow with curl

$
0
0

I have a script that I use on the vCenter servers to launch when an alarm is triggered and this script will use curl to start a vRO workflow.  Everything has been working great until I finished upgrading all the vRO servers to 7.x  Now I am getting this error

 

server:~ # /root/scripts/alarmaction.sh

* About to connect() to x.x.x.x port 8281 (#0)

*   Trying x.x.x.x... connected

* Connected to x.x.x.x (x.x.x.x) port 8281 (#0)

* successfully set certificate verify locations:

*   CAfile: /etc/ssl/certs/root64.pem

  CApath: /etc/ssl/certs/

* SSLv3, TLS handshake, Client hello (1):

} [data not shown]

* error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol

* Closing connection #0

curl: (35) error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown

 

OK so a cipher or something got removed in the 7.x version.  Can anyone else me which one exactly and how I add the cipher needed to connect again?

 

Below is my alarmAction.sh in case anyone could use something like this

 

#!/bin/sh

 

vcAlarm() {

 

# Create variables to store the values consumed by the Invoke-RestMethod command.

server="x.x.x.x"

url="https://$server:8281/vco/api/workflows/408d8e4d-1a95-46a4-bca6-efa3c24f81bb/executions"

 

 

# The cmdlet handles URL encoding.

 

 

cat > ./alarmProps.txt << EOF

<execution-context xmlns="http://www.vmware.com/vco">

    <parameters>

        <parameter type="string" name="VMWARE_ALARM_NAME" scope="local">

            <string>${VMWARE_ALARM_NAME}</string>

        </parameter>

  <parameter type="string" name="VMWARE_ALARM_ID" scope="local">

            <string>${VMWARE_ALARM_ID}</string>

        </parameter>

  <parameter type="string" name="VMWARE_ALARM_TARGET_NAME" scope="local">

            <string>${VMWARE_ALARM_TARGET_NAME}</string>

        </parameter>

  <parameter type="string" name="VMWARE_ALARM_TARGET_ID" scope="local">

            <string>${VMWARE_ALARM_TARGET_ID}</string>

        </parameter>

  <parameter type="string" name="VMWARE_ALARM_OLDSTATUS" scope="local">

            <string>${VMWARE_ALARM_OLDSTATUS}</string>

        </parameter>

  <parameter type="string" name="VMWARE_ALARM_NEWSTATUS" scope="local">

            <string>${VMWARE_ALARM_NEWSTATUS}</string>

        </parameter>

  <parameter type="string" name="VMWARE_ALARM_TRIGGERINGSUMMARY" scope="local">

            <string>${VMWARE_ALARM_TRIGGERINGSUMMARY}</string>

        </parameter>

  <parameter type="string" name="VMWARE_ALARM_DECLARINGSUMMARY" scope="local">

            <string>${VMWARE_ALARM_DECLARINGSUMMARY}</string>

        </parameter>

  <parameter type="string" name="VMWARE_ALARM_ALARMVALUE" scope="local">

            <string>${VMWARE_ALARM_ALARMVALUE}</string>

        </parameter>

  <parameter type="string" name="VMWARE_ALARM_EVENTDESCRIPTION" scope="local">

            <string>${VMWARE_ALARM_EVENTDESCRIPTION}</string>

        </parameter>

  <parameter type="string" name="VMWARE_ALARM_EVENT_DESCRIPTION" scope="local">

            <string>${VMWARE_ALARM_EVENT_DESCRIPTION}</string>

        </parameter>

  <parameter type="string" name="VMWARE_ALARM_EVENT_USERNAME" scope="local">

            <string>${VMWARE_ALARM_EVENT_USERNAME}</string>

        </parameter>

  <parameter type="string" name="VMWARE_ALARM_EVENT_DATACENTER" scope="local">

            <string>${VMWARE_ALARM_EVENT_DATACENTER}</string>

        </parameter>

  <parameter type="string" name="VMWARE_ALARM_EVENT_COMPUTERESOURCE" scope="local">

            <string>${VMWARE_ALARM_EVENT_COMPUTERESOURCE}</string>

        </parameter>

  <parameter type="string" name="VMWARE_ALARM_EVENT_HOST" scope="local">

            <string>${VMWARE_ALARM_EVENT_HOST}</string>

        </parameter>

  <parameter type="string" name="VMWARE_ALARM_EVENT_VM" scope="local">

            <string>${VMWARE_ALARM_EVENT_VM}</string>

        </parameter>

  <parameter type="string" name="VMWARE_ALARM_EVENT_NETWORK" scope="local">

            <string>${VMWARE_ALARM_EVENT_NETWORK}</string>

        </parameter>

  <parameter type="string" name="VMWARE_ALARM_EVENT_DATASTORE" scope="local">

            <string>${VMWARE_ALARM_EVENT_DATASTORE}</string>

        </parameter>

  <parameter type="string" name="VMWARE_ALARM_EVENT_DVS" scope="local">

            <string>${VMWARE_ALARM_EVENT_DVS}</string>

        </parameter>

    </parameters>

</execution-context>

EOF

 

 

 

 

# Now, run the Invoke-RestMethod command with all variables in place.

curl -S -i -L -v --key /root/scripts/cert/vco.key --cert /root/scripts/cert/vco.crt --cacert /root/scripts/cert/root64.cer -H "accept:application/xml" -H "content-type:application/xml;charset=UTF-8" -H 'Authorization="Basic base64pass"' -u "user:password" -X POST $url -d @alarmProps.txt

 

}

 

 

vcAlarm

rm ./alarmProps.txt -f


Viewing all articles
Browse latest Browse all 6251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>