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 Admin-> Script Templates (under Monitoring)-> New Template.
  2. 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.
    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.
    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.

  6. Enter complete content of script file.
  7. Enter the time to wait for script execution completion.
  8. 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.
  9. 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.
  10. Click on Test Script to test the script.
    1. If required you can set threshold values:
    2. Configure the threshold value and select the match condition.
    3. Configure the Rearm Value.
    4. Specify the number of times the threshold can be violated consecutively to raise an alarm.
    5. Configure Alarm Message and Severity.
      To disable threshold, click Disable Threshold link.
  11. Click on Save button to save the template.
  12. Select the devices you want to which you want to associate this template, and move them to Selected devices column.
  13. Click on Associate button.
You have successfully created a script monitoring template and associated it to devices.

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.

Copyright © 2012, ZOHO Corp. All Rights Reserved.
Network Monitoring Software from ManageEngine