You can configure an alarm to run a script or a command when the alarm is triggered.
About this task
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:
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:
You can attach the script to any alarm on any object without changing the script.
- In the Actions tab of the Alarm Settings dialog box, click Add to add an action.
- In the Actions column, select Run a command from the drop-down menu.
- In the Configuration column, type script or command information:
For this type of command...
EXE executable files
Full pathname of the command. For example, to run the cmd.exe command in the C:\tools directory, type:
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. For example:
c:\tools\cmd.exe AlarmName targetName c:\windows\system32\cmd.exe /c c:\tools\cmd.bat alarmName targetName
- (Optional) Configure alarm transitions and frequency. See Specify Which Actions to Perform When Triggered.
What to do next
Click OK to save the alarm definition and exit the dialog box, or navigate to a different tab to make further changes.