You can configure an alarm to run a script or a command in the vSphere Web Client when the alarm is triggered.
Use the alarm environment variables to define complex scripts and attach them to multiple alarms or inventory objects. For example, you can write a script that enters the following trouble ticket information into an external system when an alarm is triggered:
- Alarm name
- Object on which the alarm was triggered
- Event that triggered the alarm
- Alarm trigger values
When you write the script, include the following environment variables in the script:
- VMWARE_ALARM_NAME
- VMWARE_ALARM_TARGET_NAME
- VMWARE_ALARM_EVENTDESCRIPTION
- VMWARE_ALARM_ALARMVALUE
You can attach the script to any alarm on any object without changing the script.
The script runs on the vCenter Server machine, and it runs even if you close the vSphere Web Client.
Prerequisites
Required Privilege:
or