ManageEngine® Applications Manager
Custom script monitoring can be a tedious task if the output of the scripts that are run, are to be monitored manually. Applications Manager provides with script monitoring functionality to ease the process by automatically monitoring the output of in-house custom scripts (Windows/Linux) and by creating alarms as per the configuration. Script monitor allows you to monitor the script that is present in the local system or in the remote system, transfers the output to an Output File, parses the output and executes the actions configured.
To add Script Monitor, follow the given steps:
Click New Monitor. Choose Script Monitor.
Enter the Display Name of the Monitor.
Choose whether the script to be monitored is present in the Local Server or in a Remote Server
If it is Local Server, Give the absolute path of the Script to be Monitored and also the absolute path of the directory from which the script should be executed. The execution directory should in the same hierarchy of the 'script to be monitored' directory structure.
Select the script location as command or script / batch file.
Specify the absolute path of the script / command to be monitored.
Specify the absolute path of the execution directory from which the script should be executed.. The execution directory should in the same hierarchy of the script to be monitored directory structure.
If you want to monitor a tabular Output file, enter the
details of the tables - Name, String and Numeric column attributes, delimiter
and also specify which attribute is the Unique Column.
Note: Inorder to identify a tabular output file, execute the following commands before and after the actual script.
echo <--table <table-name> starts-->
echo <--table <table-name> ends-->
This would enable Applications Manager to identify the Output File's table.
Even if you're using a command instead of a script as input, then the output of the command should be in the above format. It is also mandatory to have the headers and footer in the command output as the first line in the file.
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, then enter the server's Host Name / IP Address. Choose the mode of monitoring - Telnet or SSH.
Enter the User Name and Password of the server.
Enter the Port number - Default Telnet port no: 23, SSH: 22
Specify the command prompt value, which is the last character in your command prompt. Default value is $ and possible values are >, #, etc.
Upon adding the script monitor, you can view the details of the newly added Script Monitor
To monitor a script interfacestatus.bat that creates a user defined table called InterfaceStats and user defined parameters like DiskStatus, DiskErrors and No. ofProcess, in the output file interfacestatusoutput.txt
In the Script Monitor creation form, give the absolute path of the script : c:\interfacestatus.bat
<--table InterfaceStats starts-->
Name IP In Out
eth0 192.168.1.1 123451 234567
eth1 192.168.1.2 345633 453267
<--table InterfaceStats ends-->
Give the absolute path of Output file: c:\interfacestatusoutput.txt
Give DiskStatus as the string attribute, No.ofProcess and DiskErrors are the numeric attributes with Delimiter "="
If you want to monitor statistics in a table format , select Tables in output file.
Here, we have the table InterfaceStats with the stats Name, IP, Status, In, Out where Name, IP, Status are string attributes; In & Out are numeric attributes. The Delimiter is the separater between the two column names -> space. If tab is the delimiter, then give \t . Usually tab will be the delimiter for sql queries results.
Note: The starting tag of the table, InterfaceStats is "<--table InterfaceStats starts-->" and the end tag is "<--table InterfaceStats ends-->". Also, the first line of the table should contain the attribute names. The attribute names or the column names should also be separated by the same delimiter used to separate the data rows and that is specified as the column delimiter. In this case, they are Name, IP, Status, In and out. The remaining lines between the start and end tag should comprise of the actual data. Make sure that the delimiter for the table is unique and you should specify that as the column delimiter.
Unique Column is the attribute that doesn't repeat itself in the rows and identify the row by that value. Here it is IP.
Monitor Information - Script Monitors | Create Other New Monitors