Script monitoring involves the use of custom scripts that allow network admins to monitor and retrieve data suited to their needs. The tedious task of creating a script, editing it, and executing it in the terminal or command prompt has been simplified with OpManager bringing in its custom script monitoring feature that allows you to do all the above things under a single management console.
Script Monitoring templates help you create custom scripts to monitor custom parameters.
Follow the steps given below to add script templates
Note:
OpManager has a default set of ready-to-use scripts that are available here. Import them and associate them to your devices to start using them.
To create a script template for cache memory, that is used to retrieve the cache memory of a Linux system with 15 mins monitoring interval and 10 seconds as timeout while being executed from the monitoring machine,
If the option is selected as
When a script is down or becomes active again, an alarm is raised to notify the user. An alarm message will be displayed in the notification. This alarm message is customizable and you can specify your message in the Script Body field while adding a script template.
The format for an alarm message: Message:<Custom Message>
The Output of the said syntax will be "Message: This is a custom message"
The alarm message examples for the script languages that are most commonly used and their corresponding output messages are provided below.
Alarm message examples:
VB Script
WScript.Echo "Message: This is a custom message"
Powershell Script
Write-Host "Message: This is a custom message"
Shell Script
echo "Message: This is a custom message"
When you do not specify the message description in the Script Body field, OpManager, by default, will display the script name along with its status as the alarm message (<scriptMonitorName>is up or <scriptMonitorName> is down).
Exit code is the return value of a script.
Hence, make sure that your exit code is 0 so that the script is up and running.
Specifying the format of the data used is important because the output data of the scripts are used to generate graphs and as are defined as input values for threshold limits for monitors.
The data should be specified in the given format below.
Data:
Instance1 value1
Instance2 value2
... ...
InstanceN valueN
The lines printed after the keyword Data: will be considered as the output data of the script. Every single data line will have an instance-value pair. The instances and values will be separated by a space, with instances being to the left of the space, and values being to the right of the space.
To know more about output formats in OpManager's script monitoring, click here.
The test script option allows you to run the script check the same for its output.
When you associate a device with a script template, the device will be monitored for that particular script's functionality. Now you can create a template for your frequently used functionalities and associate them to devices of your choice instead of creating them from scratch every now and then.
You can export scripts in the form of XML formats and then import them to be used on other OpManager servers.
You can import scripts from other OpManager servers and then associate them with your devices for easier monitoring.
Thank you for your feedback!