Tuesday, July 29, 2008

Simpler than I thought

OK, Here's the situation:
I've got an ITM/TBSM environment where the tech guys look at ITM screens and the helpdesk and managers look at TBSM screens.

I've got a custom canvas or two for eye-candy on the TBSM. The problem is that when the helpdesk or managers looks at the messages coming over from ITM - they get a heart attack! A simple "no room on disk" turns into : NT_Disk_Full [(Free_Megabytes < 1000000) ON "Primary:AlphaServer:NT" ON D: (Free_Megabytes = 114)]

What I want to do is just change the main text which is sent from ITM to TBSM. Sounds simple?

Now, there are three basic ways in which you can find how to do something in Tivoli:

  1. You can read the basic documentation. However, some things are written in a comprehensive, rather than simple fashion:
    I defy anyone who is not an expert to make use of Chapter 6 of the Admin's guide : Customizing event integration with Tivoli Netcool/Omnibus!
  2. You can go online to a number of forii (plural of forum) and places and ask. However, you probably won't get a cook-book answer - unless you're pointed to somewhere else.
  3. The third option are the how-to guides which are periodically published. The most well known are the Redbooks - but I didn't find what I'm looking for there.
    I did find Coding an event mapping file for ITM TEC Event Forwarder - but it's got too much TEC specific hay which hides the needle I'm looking for.
    I also found Enriching IBM Tivoli Monitoring (ITM) Events For IBM Tivoli Business Service Manager (TBSM) in the TBSM Wiki. This is NEARLY what I'm looking for, except that it's got some BSM "hay" and modifies much too many files or databases to be "simple" enough for my needs.

I did all of this, came to the conclusion that it's complicated, and left it alone for a few months. Till last week when I HAD to do it :)

I did, however, get enough out of all sources (which are excellent sources - especially the last one, which talks about adding important information to the situation data en-route to TBSM) to do it myself and discover that the beast wasn't as bad as I had feared. I could even create this simple how-to which I will share with you.

The secret lies in what are called "mapping files". These mysterious configuration files lie in the directory C:\IBM\ITM\CMS\TECLIB (replace C:\IBM\ITM with whatever's relevant to you) and defines what changes, if any, ITM makes to the various parameters it passes to TEC or Omnibus through the EIF adapter.

Open one up and you'll see a thick wall of XML code.

The good thing is that you can ignore ALL the *.map files which already exist - they're used for integration with ITM5 and DM3.7 (as far as I can tell)

I created a new file called qnt.map 

The first lines I just copied/pasted from an existing map file and then then I changed the <id> from the original file
Then I added my first original material - the situation I'm interested in. The mapAllAttributes tell ITM to send all the attributes, including those I haven't changed.
The information between dollars comes from the attributes which are relevant to the situation. Edit your situation and click the "add conditions" buttons to see the what items you can use.

Note the use of $hostname$ for the server which triggered the situation.

<itmEventMapping:agent                                                         
    xmlns:itmEventMapping="
http://www.ibm.com/tivoli/itm/agentEventMapping"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.ibm.com/tivoli/itm/agentEventMapping agentEventMap.xsd">

    <id>99</id>                                                                
    <version>6.2.0</version>                                                   
    <event_mapping>              

         <situation name="NT_Logical_Disk_Space_Critical" mapAllAttributes="Y">
         <class name="NT"/>
             <slot slotName="msg">

                 <literalString value="There is only $NT_Logical_Disk.%_Free$ percent / $NT_Logical_Disk.Free_Megabytes$ Megabytes free on server $hostname$ $NT_Logical_Disk.Timestamp.TIMESTAMP$"/>
             </slot>
         </situation>

         <situation name="NT_Services_Automatic_Start" mapAllAttributes="Y">
         <class name="NT"/>
             <slot slotName="msg">
                 <literalString value="The Service $NT_Services.Service_Name$ is down on server $hostname$ $NT_Logical_Disk.Timestamp.TIMESTAMP$"/>
             </slot>
         </situation>

    </event_mapping>
</itmEventMapping:agent>

After you have your file, run the command tacmd -t all so that ITM will load the new mapping file.

THAT'S IT!

Triggering those situations will lead to Omnibus messages which look like this:

Normal Event Text

 

instead of the cryptic formula which we had before.

Just goes to show - sometimes things are simpler than I think!

-- Robert

6 comments:

Anonymous said...

Robert,

We'd normally recommend that this is done in the Netcool/OMNIbus Probe rules files since you already had all of the information needed coming across from ITM in the event. Check out the Netcool/OMNIbus v7 Probes and Gateway manual for all of the capabilities within the rules file.

The approach for the mapping files you found on the TBSM wiki was originally intended to be very focused on getting additional data into the event and event slots. From there, the intent was to drive
TBSM service model creation WITHOUT using TADDM or Netcool/Impact at all. The whole premise of DevCampTivoli is to do more with less! :-)

As you found, your problem can be solved in other ways!

Doug
BSM/ITSM Blog: http://dougmcclure.net

Robert said...

Hi Doug,
Perhaps I should have prefaced by saying that I'm much more comfortable "mucking about" in ITM rather than TBSM - at least for now ;)

I looked at http://publib.boulder.ibm.com/infocenter/tivihelp/v8r1/index.jsp?topic=/com.ibm.netcool_OMNIbus.doc/pg/toc.html. I assume this is what you mean? It's very comprehensive, but not cook-book-like. Nothing pops out to the newbie saying "This is where you change ITM messages".

Also, with this system I can add ITM data from the attribute group which is not part of the origional message. To get this from Omnibus, I'd have to use Impact - which ratchets up the complexity yet another notch :)

Thanks for the comment!

Anonymous said...

Robert,

This is the manual:

http://publib.boulder.ibm.com/infocenter/tivihelp/v8r1/topic/com.ibm.netcool_OMNIbus.doc_7.2.1/omn_pdf_prgw_master_721.pdf

It does take some getting used to, but it's pretty much all Regular Expression stuff you'd be doing to parse and populate from your "$" values to your "@" values to map, concatenate, delete or replace content to build you events.

Keep in mind, this is all OMNIbus - nothing to do with TBSM.

Doug

Anonymous said...

Robert,

I'm attempting to use this on an AIX system, integrating to a TEC server. The tacmd will not accept -t all flags.

Robert said...

Stefan,

The tacmd refreshTEInfo was added in 6.2. Is that your version?

In any case, you can get the same result by stopping/starting the TEMS server.

Thanks for reading :)

Nickname unavailable said...

FYI, in 6.2.1, this will all be integrated into the product, you can customize the msg without using the map files.

Heath