VMware {code} Community
iovm
Contributor
Contributor

Need to write simple shell/python script vcenter appliance alarms

Hope somebody from VMware can help.

Need to send vCentre alarms to third party monitoring tool BigPanda using Run script Alarm trigger methode.

New to Python and Shell scripting unable to write a single simple script with vCenter alarms environment variables allowing script to get triggered as soon as alarm is triggered on vCenter.

Python or shell script anything will work, just to gather alerts data as soon as alarm is triggered on vCenter end.

Sample scripts are there

 

curl -X POST -H "Content-Type: application/json" \ -H "Authorization: Bearer <YOUR TOKEN>" \ https://api.bigpanda.io/data/v2/alerts \ -d '{ "app_key": "<YOUR APP KEY>", "status": "critical", "host": "production-database-1", "check": "CPU overloaded" }'

 

Here instead of production-database-1 , we want to use environment alarm variables so that only the alarm triggered on object should be visible.

Note: If I run the curl -x above command, its working directly on the VCSA shell, however not through vcenter alarm if I use the path /root/script.sh

 

Can somone help in this case and guide me if something I am missing 

Looking forward to hear something productive.

 

 

Reply
0 Kudos
0 Replies