Wednesday, March 12, 2008

ITM 6.1: Listing Situations Running on Individual Systems

A common requirement for monitoring staff is to provide management with a list of "monitors" running on individual systems. This was easy to do in the DM and ITM 5.X era, but not so easy with ITM 6.1 since situations (monitors) are applied to Managed Systems List (MSL) for the most part and not individual managed systems. One can list the MSLs in a situation distribution list using SOAP or the tacmd command but then for each MSL found they would have to use another SOAP call to get the managed systems that belong to a MSL and then another call to get the hostname for the Managed System.

Here is a method using EIB SQL to get information with one SOAP call.

The distribution of a situation is controlled by entries in the TOBJACCL table. The important columns in the EIB table are OBJNAME and NODEL. OBJNAME is the situation name and NODEL is either a MSL name or Managed System Name. The TOBJACCL table will contain one row for each distribution target in the situation configuration. For example, if you configure a situation to be distributed to two MSLs and a specific Managed System, then there will be three rows in the table for the situation plus an entry for each managed system contained within the two Managed System Lists.


The next piece of the puzzle is the TNODELST table. This table maintains all of the Managed System Lists. For a more detailed description of this table read this Blog entry. This table will provide us with the actual hostname of the installed managed system. The columns we are interested in this table are NODE, NODELIST, and NODETYPE. The NODE column we will select in our SQL, and NODELIST will appear in our SQL WHERE clause to join the TOBJACCL table on the NODEL column. We will also use NODETYPE in the WHERE clause to only select the Managed System entries, not the MSLs.

Here is the SQL:
SELECT TOBJACCL.OBJNAME,TNODELST.NODE
FROM O4SRV.TNODELST,O4SRV.TOBJACCL
WHERE TNODELST.NODELIST=TOBJACCL.NODEL AND TNODELST.NODETYPE="V"

If we wanted to select for a specific situation we could add a condition to the WHERE clause: TOBJACCL.OBJNAME="SIT_NAME"

If we wanted to select for a specific host we could do this:
TNODELST.NODE ="HOSTNAME"

No comments: