Thursday, March 6, 2008

Custom Script Monitors with ITM 6.1 and the UA

ITM 6.1 has the capability to use scripts as monitors, you have to use the Universal Agent - but once that is installed you have to do some further configuration. The Universal Agent uses things called Data Providers, by default the Script data provider is enabled when the Universal Agent is installed. There are other data providers like ODBC, HTTP, SNMP and API. I have posted articles on HTTP and SNMP on this blog, look them up for fun.

Here is a working example of a simple Scipt Data Provider.

First you have to build a Metafile, the file defines the application name, data types, script to be run and the interval.

Let's say you have a script to monitor paging space, called ps.sh. You build a metafile that will define all of the attributes returned by the script. In this case, our script return the number of free megabytes and that is it.

The first line defines an Application, in this case - we call it "Paging_Space".

The next line defines a name for the specific set of attributes (Linux_Paging_Space), that it is Sampled Data (S), that we want a TimeStamp added to the data and finally the interval in seconds that we want the script to be executed.

Line 3 is our Source, we have defined a type of "script" followed by the name of the script.

Line 4 defines a field for the data that is returned by the script. FreeMBPageSpace is defined as a 32 byte data element.

//APPL Paging_Space
//NAME Linux_Paging_Space S AddTimeStamp Interval=300
//Source script LinuxPageSpace.sh
FreeMBPageSpace D 32

This file needs to reside in the \IBM\ITM\TMAITM6\METAFILE directory. The script you want to call from the Metafile needs to reside in the \IBM\ITM\TMAITM6\SCRIPTS directory.

Recycle the UA when you are done the data will begin flowing into TEP shortly. Once you see data, build your Situations and set your thresholds as you would any other situation.

No comments: