|
This section is common to all the editions of IT360, as per the below constraints;
Professional Edition
Enterprise Edition [Applicable to Probes only, and not applicable / relevant to the Central Server, since the configuration of the monitors happens only at the Probe level. However, you may see these discovered monitors from the Central Server]
MSP Edition [Applicable to Probes only, and not applicable / relevant to the Central Server, since the configuration of the monitors happens only at the Probe level. However, you may see these discovered monitors from the Central Server]
IT360 provides Script Monitoring functionality, to automatically monitor the output of ad-hoc Windows/Linux/Solaris scripts that are used, in-house;
During creation of a new script monitor, you need to give the location of the custom script (local / remote), attributes (numeric/string), to be monitored, the Output File, in which the output is going to be redirected, and the polling interval.
Based on the polling interval, IT360 executes the script.
The script will transfer its output to the Output File, configured. The output of the script should be in a Key=Value format, where '=' can be any delimiter.
IT360 parses the Output File and executes the actions, configured. It enables you to alert an Administrator, or automatically take corrective actions, by way of executing other OS scripts.
Reports for the attributes, configured, would be shown as graphs. Option, to enable or disable reports, is given.
Availability tab, gives the Availability history, for the past 24 hours or 30 days.
Performance tab gives the Health Status and events, for the past 24 hours or 30 days.
List view enables you to perform Bulk admin configurations.
This option would be useful, if you want to override the response time, measured for custom scripts, by using a defined value in the output file. IT360 looks for a few reserved keywords in the output file, if it matches, then it will replace the corresponding attribute.
For e.g., if the script output is looking like this;
script_availability=1 (Allowed values are 0 or 1. "0" refers to
success. "1" refers to failure.) |
Then, while parsing the output file, 'script_availability' value will be taken, and based on that the availability is calculated. The same is the case for response time, too.
Let's assume that you want to monitor a script '< filesystem.sh>' present under '/home/test-solaris/' in test-solaris machine. The output from this script is dumped to 'output.txt' file, present under the same directory. The format of 'output.txt' is as shown below;
SystemTemperature=37
TimeSinceLastReboot=30
TopPaginApp=sendmail
IOReads=1050Setting up Script Monitor:
In order to add a Script Monitor, you need to follow the below steps;
Go to 'Admin -> Servers & Applications', click on New Monitor link.
Choose Script monitor from the Add Monitor of type combo box.
For the Display Name, give some name, e.g. FileSystem.
Choose whether the script, to be monitored, is present in the Local Server or Remote Server. If the script is in a Remote Server, then make sure that you put the script in the Remote Server.
If it is in the Local Server/ Remote Server, give the absolute path of the Script to Monitor ('/home/test-solaris/filesystem.sh') and also the absolute path of the directory, from which the script should be executed ('/home/test-solaris/').
Under Output Settings, give the Output file name ('/home/test-solaris/output.txt'), with absolute path. This is the file, where the output from the script is dumped.
Enter the Name of the Non Numeric and Numeric attributes. In the Numeric area, add;
- SystemTemperature
- TimeSinceLastReboot
- IOReads
Similarly, in the String Attributes Textarea, add: TopPaginApp
Enter the value of Delimiter (=), used in the output file. By default, it is "=". If you don't specify a delimiter, then 'space' would be considered as a delimiter.
Specify the additional Arguments (if required to pass to the script). For e.g., hostname 80 http.
Set the Polling Interval. By default, it is 5 minutes.
Specify the Timeout value, in seconds. The value can be the maximum time, taken by the script to execute.
In Linux, Specify the mode, in which script should be executed. By default, it is "sh".
If the script is in a Remote Server, select the Host Name, from the list.
If the remote server is a new host, choose New Host, then enter the server's Host Name / IP Address (test-solaris). Choose the mode of monitoring - Telnet or SSH. By default, it is 'sh'.
Enter the User Name (test) and Password (test) of the server.
Enter the Port number - By default, Telnet port no: 23 and of SSH: 22.
Specify the command prompt value, which is the last character in your command prompt. Default value is $, and possible values are >, #, etc.
Once all the values are entered, select Add Monitor(s).
The success message should be displayed. Click 'Monitor Details > Script Monitor', and go to the create script, to view the details.
Let's assume that you want to monitor a script '<prustat.sh>', present under '/home/test-solaris/', in test-solaris machine. The output from this script is dumped to the 'output.txt' file, present under the same directory. The format of 'output.txt' file is as shown below;
"<--table prustat starts-->"
PID CPU Mem Disk Net COMM
7176 0.88 0.70 0.00 0.00 dtrace
7141 0.00 0.43 0.00 0.00 sshd
7144 0.11 0.24 0.00 0.00 sshd
3 0.34 0.00 0.00 0.00 fsflush
7153 0.03 0.19 0.00 0.00 bash
99 0.00 0.22 0.00 0.00 nscd
7146 0.00 0.19 0.00 0.00 bash
52 0.00 0.17 0.00 0.00 vxconfigd
7175 0.07 0.09 0.00 0.00 sh
98 0.00 0.16 0.00 0.00 kcfd
"<--table prustat ends-->"Note: The table header, "<--table prustat starts-->", is mandatory, and should follow the same format, as mentioned. Here 'prustat' should be replaced by the Table Name, as explained below;
Setting up Script Monitor:
To start with, follow the same instructions, as mentioned above, for Scalar, till point 6.
Now, select Tables, in Output file check box.
For the Table Name, provide some name (e.g. prustat). Note: This name should be present in the table header ("<--table prustat starts-->") in the output file.
For the Numeric Attributes area, provide the column names in the script output that are numeric;
- CPU
- Mem
- Disk
- Net
For the String Attributes, provide the column names in the script output that are non-numeric;
- PID
- COMM
For the Unique Column, provide the column names that can identify a row data. This can be a single value or multiple value;
- PID
- COMM
For the Column Delimiter, provide the column separator. The default value is a space.
In case, if you have scripts that output multiple tables, then you can select More, and configure the values.
- Once all the values are entered, select Add Monitor(s).
Using Script Monitor to Monitor SNMP OIDs:
Please look at the steps below, for creating a script monitor;
Create a script file (say 'script.sh'), under the '/Home/User' directory.
snmpwalk -v 1 -c public app-w2k1 CPQHLTH-MIB::cpqHeFltTolPowerSupplyRedundant.0.1| awk '{ y = $1; x = $4 ; gsub(/[a-zA-Z()]/, "", x)}
{print y " = " x}'>> output.txt
snmpwalk -v 1 -c public app-w2k1 CPQHLTH-MIB::cpqHeFltTolPowerSupplyRedundant.0.2 | awk '{ y = $1; x = $4 ; gsub(/[a-zA-Z()]/, "", x)}
{print y " = " x}' >> output.txt
Script to Monitor '/Home/User/script.sh'
Directory from which the script should be executed '/Home/User'
Under Output Settings,Output File '/Home/User/output.txt'Numeric Attributes <CPQHLTH-MIB::cpqHeFltTolPowerSupplyRedundant.0.1>
<CPQHLTH-MIB::cpqHeFltTolPowerSupplyRedundant.0.2>
See Also:
Creating New Monitor - Script Monitors
|