Run Command notification is used to send alert notifications from the CommServe to other client computers by executing a command script. The Run Command can be located on the CommServe or remote machines, but is executed only on the CommServe machine.
The Command Processor executable file which is required to generate command line alert notification can be created on the CommServe or remote clients e.g., C:\WINDOWS\system32\cmd.exe and the location can be specified in the Command Script Location box while configuring the alert. The command can be configured with arguments; multiple arguments should be separated by spaces, which the system allows.
The following is the content of the batch file for example:
@echo %date% %time% >> c:\tmp\alert1.log
REM End Batch File
Enter the following in the Arguments field prior to adding any arguments:
where the \C signifies that the Command Processor must carry out the given command in the following string and then terminate. Note that C:\Tmp\runCommandTest.bat is the location of the batch file you wish to run when the alert criteria threshold is met.
While adding the arguments manually add quotation marks around the tokens, e.g., "$<DETECTED CRITERIA>$"; this resolves any white space issues. The Arguments field will resemble the following format:
/C C:\Tmp\runCommandTest.bat "$<ALERT NAME>$" "$<DETECTED CRITERIA>$"
Below example displays the logs after Command Line notification alert has been generated. These logs are generated at C:\Program Files\<Company>\<Product>\Log Files\EvMgrS.
492564 7892c 05/04 17:55:21 ### processRunCommand() - About to spawn [C:\Program Files\<Company>\<Product>\Base\qlogin.exe]["C:\Program Files\<Company>\<Product>\Base\qlogin.exe" -u admin -clp ""].
492564 7892c 05/04 17:55:21 ### CvProcess::StartProcess() - Preparing to launch process: <C:\Program Files\<Company>\<Product>\Base\qlogin.exe>. Priority: <Normal>. Value: <32>.
No prior configuration is required to generate Command Line notification alerts.
The command line script is created when generating the alert and is executed on the CommServe when the alert criteria threshold is met.
Use the following steps to generate Run Command notifications for alerts:
- From the CommCell Console ribbon, click Alerts.
- In the Alerts dialog box, click Add.
- Enter a name for the alert in the Display Name box.
- Select a Category and Alert Type and click Next.
- Select the clients or client groups that you want to associate with this alert and click Next.
To exclude specific client groups from receiving alert notifications, mark the client group with an 'X' mark.
- Select the notification criteria to be used and click Next.
- On the Notification Type(s) Selection page, click the Run Command tab to send the alert by executing a command script.
- Click the Select [Run Command] for notification check box and do the following:
- By default, the command is executed from your local drive. If the command resides in a network share, click Use Network Share and click the Change button to provide the account information to access the network share.
- Specify the location of the command processor executable file in the Command Script Location box. You can also click Browse to browse the location of the command.
- Specify the command arguments and manually add quotation marks around the argument values. You can also click Browse to locate the arguments. See Available Alert Tokens for a list of tokens or arguments.
- Click Next.
- On the Summary page, review your selections and click Finish.