Creating Script Monitoring Templates

Script Monitoring templates help you create custom scripts to monitor custom parameters .

 

Follow the steps given below to add script templates

  1. Go to Settings → Monitoring → Script templates.
  2. Click Add New and provide a name and description for the template.
  3. Configure the Monitoring Interval.
  4. Specify the Unit for the monitored parameter.
  5. Enter the command to run the script, as if provided in command prompt.
Example:
cscript ${FileName}.vbs
Note that ${FileName} must be followed by script file extension. You may also pass arguments. Argument list may use variable ${DeviceName} which will be replaced with the monitored machine name in run time. Other supported variables are ${UserName} - WMI/CLI username, ${Password} - WMI/CLI password, ${SNMPRead}- SNMP read community string. For example,
cscript ${FileName}.vbs ${DeviceName} ${UserName} ${Password}

Script Output Format

In order to store the result of the script in DB, the output must be in the format given below.
 

Message:This message will be used as alarm message.
Data:
Instance1           value1
Instance2           value2
...                       ...
InstanceN           valueN

Exit code will be used to set the status of the script monitor. Exit code "0" for up , any other exit code for down. Only numeric values are allowed as statistical data. The instance name and value must be separated by a TAB space(t). Status checking scripts may NOT contain data part. If there is no message in output, a default message will be used for alarm message.

 

  1. Script Body: Enter complete content of script file.
  2. Timeout Enter the time to wait for script execution completion.
  3. Execute From: Select the machine from which you want to execute the script. Linux scripts can be executed either from the server, where OpManager is running, or from the monitored machine.
  4. Executing Directory: Provide the directory path from which you want to execute the script. You may use variables ${TempDir} or ${UserHomeDir} which means OpManager temporary directory and user's system home directory repectively.
  5. Threshold Details: Configure threshold for the script monitor if any.
  6. Click on Save button to save the template.

You have successfully created a script monitoring template



Editing Script Templates
To Edit a script template

  1. Click on Edit icon corresponding to the script template that you want to edit.
  2. Carry out the necessary modifications and Save it.

 

Importing/Exporting Script Templates
The import/export options allows you to share scripts that are created by you with OpManager community and use the scripts shared by others. Use this form to share the script with OpManager community.

Import scripts

  1. Click on Import button that is available in the Script Templates page.
  2. Click on Browse button to locate the script (.xml file).
  3. Click Import.

The script has been successfully imported to OpManager.

Export Scripts

  1. Click on Export XML icon corresponding to the script that you want to export.
  2. Click on Save to save the script.

 

Copying Scripts
OpManager allows you to save a copy of the script, modify it and use it for other monitoring requirements.

  1. Click on Copy As icon that is available in the Script Templates page. The script template opens.
  2. Carry out the necessary modifications and Save it.

 

Deleting Scripts
To delete a script, click on the the Delete icon corresponding the script template.