The Command property provides the initial part of the command or script to be executed. The additional part of the command or script is provided by the value specified for the Text Property of any action that uses this template. If you do not enter a value for the Command property, you must specify the entire command in each action that uses the template.
Note: It is recommended that you follow the command you enter with a space, because any text specified for the Text property in an action using the template is appended directly to the command.
To execute an executable
Enter
command
where:
command
is an executable command (.exe), optionally followed by call-line arguments.
To execute a DOS program or script
Enter
cmd.exe /C program-name [ arg ] ...
where:
program-name
is the name of DOS program or script that you have put into data-folder\alarm-scripts on the Operations Sentinel server.
arg
is a command-line argument for the program or script. You can specify additional arguments in the Text property of each action that uses the template. See About Action Text Property Values for more information.
To execute a Visual Basic script
Enter
cscript.exe script-name.vbs [ arg ] ...
where:
script-name
is the name of a Visual Basic script that you have put into data-folder\alarm-scripts on the Operations Sentinel server.
arg
is a command-line argument for the script. You can specify additional arguments in the Text property of each action that uses the template. See About Action Text Property Values for more information.
By default, cscript.exe handles script errors and after completion exits with an exit status of 0. To return the status to Operations Sentinel, you must disable host error handling in the script using an On Error Resume Next statement. This allows execution to continue despite a run-time error. You can then build the error-handling routine inline within the procedure and return the status using the Quit method. For more information, see the Microsoft Windows Script Host documentation available online.
Click here to see an example VBScript that illustrates how you can detect an error in your script, log the error information in the Windows Application Event log, and then exit the script using the error number as the return value.
Note: You should not specify a program that displays windows; the windows will not appear when the action executes.