6.0.1

Table Of Contents
n
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: Alarms.Create alarm or Alarms.Modify alarm
Procedure
1 On the Actions tab of the alarm definitions wizard, click Add to add an action.
2 In the Actions column, select Run a command from the drop-down menu.
3 In the Configuration column, type script or command information:
For this type of command... Enter this...
EXE executable files
Full pathname of the command. For example, to run the cmd.exe
command in the C:\tools directory, type:
c:\tools\cmd.exe.
BAT batch file
Full pathname of the command as an argument to the
c:\windows\system32\cmd.exe command. For example, to run the
cmd.bat command in the C:\tools directory, type:
c:\windows\system32\cmd.exe /c c:\tools\cmd.bat.
NOTE The command and its parameters must be formatted into one string.
If your script does not make use of the alarm environment variables, include any necessary parameters
in the configuration field. Enclose parameters in curly brackets. For example:
c:\tools\cmd.exe {alarmName} {targetName}
c:\windows\system32\cmd.exe /c c:\tools\cmd.bat {alarmName} {targetName}
The script can run on any platform. You must provide the path to the script and argument keys. For
example:
/var/myscripts/myAlarmActionScript {alarmName} {targetName}
4 (Optional) Configure alarm transitions and frequency.
5 Click Finish to save the alarm settings.
Alarm Environment Variables for Scripts
To simplify script configuration for alarm actions, VMware provides environment variables for VMware
alarms. Use the variables to define more complex scripts and attach them to multiple alarms or inventory
objects so that the alarm action occurs when the alarm triggers.
Table 44. Alarm Environment Variables
Variable Name Variable Description Supported Alarm Type
VMWARE_ALARM_NAME The name of the triggered alarm. Condition, State, Event
VMWARE_ALARM_ID The MOID of the triggered alarm. Condition, State, Event
VMWARE_ALARM_TARGET_NAME The name of the entity on which
the alarm triggered.
Condition, State, Event
VMWARE_ALARM_TARGET_ID The MOID of the entity on which
the alarm triggered.
Condition, State, Event
VMWARE_ALARM_OLDSTATUS The old status of the alarm. Condition, State, Event
VMWARE_ALARM_NEWSTATUS The new status of the alarm. Condition, State, Event
Chapter 4 Monitoring Events, Alarms, and Automated Actions
VMware, Inc. 115