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

Sunday, July 20, 2008

A Man on the Moon

I'll write a longer post tomorrow of the next day, but I've got to put something up now. 39 years ago, at 02:56 GMT 21st of July, 1969 a man, Neil Armstrong, stepped on the Moon.

"That's one small step for [a] man, one giant leap for mankind"

If thinking about that doesn't make you pause, then think about it again.

Read more about the mission here on Kennedy Space Center's site and Wikipedia.

During the last few days there have been some amazing results from some newer missions:
The EPOXI mission has video showing the Moon orbiting the Earth. I know that we all know this logically, but here you can actually SEE the moon moving!


For more details, see the Bad Astronomy Blog - which is actually very good.

 

Another space probe, called SELENE, has taken pictures of the moon which show debris from a later moon landing, Apollo 15.

Last link for now - VERY high resolution images of Tycho, one the largest craters on the Moon taken by SELENE,

 

Think about it again when you look up at the moon. 39 years ago there was someone there!

-- Robert

Friday, July 18, 2008

TBSM tips

Due to a few bureaucratic problems. I found myself installing TADDM and TBSM about 6 times over the last few days!

 

The first good news is that everything works.
The second good news is that I've got a list of problems and solution which I can share.

 

Most of these have solutions in the documentation, but it's not always clear.
All my installations were on Windows 2003, but I assume the problems are pretty platform agnostic.

 

  1. The Omnibus service stops after a while / Error 500 in the TBSM default screen.
    For some reason, on two of the servers, the Omnibus service kept dying. This is apparently a known bug in the version of Omnibus which is shipped with TBSM 4.1.1. You can solve this problem by upgrading the Omnibus to a more current version.
    SOLUTION : Add the parameter -regexplib TRE to the startup configuration of the Omnibus server (and upgrade when you get the chance)

  2. XMLToolkit service does not start. The Tivoli Discovery Library Reader service is the component of TBSM which loads DLA files or TADDM data into TBSM, This way you don't have to build the Lines Of Business yourself, rather you can load them from somewhere where they have already been defined.
    The service wouldn't start and kept giving the message "The Tivoli BSM CCMDB Discovery Library Reader service started on Local Computer and then stopped".
    SOLUTION : Copying the file mscvr71.dll from %SystemRoot%\System32 to the toolkit's \bin directory solved the problem.


  3. TBSM starts with incorrect/blank main display screen. The other symptom is seeing the following message in the browser's java console:
    Sorry, there has been a problem responding to your request. Database may be unavailable. Please report this to the server administrator: Error rendering Velocity template: layouts/ngf-default.vm: Unable to find resource 'layouts/ngf-default.vm' not found
    at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)
    Now, if you're just reading this line, then you might figure out the solution for yourself. However, the problem is that the line is buried between many others.
    SOLUTION : Copy %NCHOME%\guifoundation\webapps\desktop\WEB-INF\system-templates\vm\layouts\html\ngf-default.vm to the directory %NCHOME%\guifoundation\webapps\dNesktop\WEB-INF\system-templates\vm\layouts


  4. The biggest problem I had was quite bizarre: The Service Component Repository was not initialized properly.
    The SCR is the repository where all the various objects (Servers, Databases, Services, etc) are kept. One of the automatic post-installation steps is the running of a script called tbsmdefaultimport. You should then see the following tab in the Service Administration screen: 
Good_SCR Unfortunately, what I saw was this : Bad_SCR

The garbled entries make it impossible to import data into TBSM, because the tree does not contain the proper entries.

SOLUTION: My solution was uninstalling/reinstalling. On the THIRD attempt, the TBSM installed correctly. Since then, Doug McClure has given me the following undocumented procedure to reset the SCR without needing to reinstall:

UNIX :
run "setdbschema -U <dbuserid> -f a". This will drop and recreate all of the tables associated with the SCR. After you have done this, you should invalidate the "Imported Business Service" and the "Component Registry". That should delete everything.

Windows:
run (using psql) the following files (found in .../XMLtoolkit/sql):
scc_staging_schema_deletes.sql
scc_schema_deletes.sql
scc_schema_setup.sql
scc_staging_schema_index_setup.sql
scc_staging_schema_setup.sql
Then you should invalidate the "Imported Business Service" and the "Component Registry"

I hope I've saved some of you some time...

-- Robert

Friday, June 27, 2008

Troubleshooting ITM OS agent on Windows

One of the most common tasks a Tivoli admin has to do is installing an OS agent (TEMA) on a server.
From my experience, it's a reasonably trouble free task, with few gotchas.
First, I'm talking mostly about local installation.
Second, the solutions mostly modify the registry - care must be used when doing so and obviously, I take no responsibility for any problems :)
Here's my list of common problems/solutions :
  1. Install from a local disk, not a network drive - i.e. no \\ in the installation directory.

  2. Simple directory names.
    The most common problems I've had are after installing Java and GSKit, the installation suddenly quits with no warning.
    This is either because:
      1. The TEMP/TMP environment variables point to a "complex" directory - i.e. one with spaces or is longer than 8 characters.
      2. The installation directory is a "complex" directory
      3. The target directory is a "complex" directory
    This is because the installation program is looking for the 8.3 format of the file (not C:\Program Files, but C:\PROGRA~1). When the registry setting HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Filesystem/NtfsDisable8dot3NameCreation is set to 0, then windows will create both filenames. If it doesn't exist, or is set to 1, then only the complex name is found and the installation fails.
    Another way of checking is running a dir /x command in a DOS box.
    <Caution>
    You must reboot the server for the new setting to be active. I find it's easier to just use simple directory names. The TEMP/TMP environment variables are changed in the Advanced settings of System Properties.
    IBM link : Setup program suddenly terminates after JRE and GSKit installation
  3. Cannot install because a reboot is pending.
    Often when I try to install ITM on a server that hasn't been rebooted in a long time, I'll get that error.
    A reboot will solve the problem, but from then on you'll have a tough time convincing people that ITM doesn't require a reboot!
    The registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations (PendingFileRename for Windows 2000) holds the list of filenames which have been marked as changed and are waiting for a reboot. Check them, if they're harmless (I often see adobe files) then just remove them from the registry (export them to a backup file first) and run the installation again. Import the files back to the registry if you like.

    Note: Since ITM6.1 Fixpack 5 Interim Fix 2, the setup ignores most of the files so this should occur less.
    IBM Link: Windows agent reboot pending to rename locked files

  4. GSKit errors in general
    GSKit is something required for ITM and it is installed by the setup program before the ITM agent itself.
    However, sometimes you'll encounter problems with GSKIT and you'll want to uninstall it. There is no built-in uninstallation for a damaged GSKit.
    Here is a step-by-step uninstall routine : http://www-1.ibm.com/support/docview.wss?uid=swg21258721
    There's also a link to ITMRemoveAll in the link - a fast and dirty uninstall for ITM.  

  5. Another option for GSKit problems is this:
    1. Manually copy Windows\InsGSKit\setup.iss to the desired hard-drive in a directory of choice. 
    2. Alter the szDir=C:\Candle\GSK7 statement to use the desired drive letter  (Since Candle management agent was running)
    3. From command line execute:  setup.exe ITM61 --logfile=D:\GSKitTemp\GSKit.log -z -s                
    -SMS -f1"D:\GSKitTemp\setup.iss"

    This will install the GSKit. Once it is completed run the setup.exe of the Agent media. This will install the agent successfully.
These are the most common problems I've had with installing ITM. They're all easily avoidable once you know about them - but are a bit voodoo-like if you don't.
Drop me a line / add a comment if you think there's something I've forgotten.
-- Robert

Wednesday, June 25, 2008

Getting the date of an ancient date

There have recently been a few studies of the ancient world which have been aided by astronomy:

Dating Julius Caesar's invasion of Britain through tides (effects of the moon) 
http://www.txstate.edu/news/news_releases/news_archive/2008/06/Caesar062308.html

Dating Odysseus's Return from the Trojan War through a (suspected) Solar Eclipse
http://www.breitbart.com/article.php?id=2008-06-23_D91G27MO0&show_article=1&cat=breaking
http://www.sciam.com/article.cfm?id=homers-odyssey-may-document-eclipse

And Thale's eclipse which I blogged about before.

A lot of this stuff I get from Rogueclassicism.

-- Robert

Using Extended Attributes in TADDM with the TADDM API

As I've mentioned before, TADDM is the heart of IBM's CMDB solution.

Now, each Configuration Item (CI) in the CMDB has a very long list of attributes; For a computer it's the computer's name, IP address, amount of memory and so on. For a database it's the list of schemas, physical files and so on.

Now, TADDM is smart and can extract just about everything possible about a system. However, there's no way in the world it can know about outside information - such as the name of the person in charge of the specific server. That's why there are a number of attributes which are not discovered automatically, but are entered manually. These are called administration attributes are mainly names, phone-numbers and so on.

Now, you may have a use for information of this sort that does not appear as one of the administration attributes. The classic example is the physical location of the server. To solve this problem, TADDM has Extended Attributes which you can create and add to any type of CI. You could add a PhysicalLocation field to every ComputerSystem and a NeedsToBeBackedUp field to every database.

The only problem is that the default reports will not show you your Extended Attributes.

There are two solutions at the moment (I understand that the default reporting options should improve by the end of this year).

The smart solution is to download the TADDM connector for TDI which will enable you to manipulate your TADDM database easily. (After you've gone through the learning curve, of course)

The simple(r) solution is to write a short Java program which will extract the information for you.

I recommend you do both - and see what works best for you. You'll certainly learn more about TADDM this way.

Here is a short Java program which will demonstrate how to use the Java API to get data out of TADDM


----- Begin ShowAttributes.java

// I don't think you need ALL these includes for this specific program to run, but they never hurt...
import com.collation.platform.model.Guid;
import com.collation.platform.model.AttributeNotSetException;
import com.collation.platform.model.ModelObject;
import com.collation.platform.model.topology.extattrib.UserData;
import com.collation.platform.model.topology.meta.UserDataAttributeMeta;
import com.collation.platform.model.topology.meta.UserDataMeta;
import com.collation.platform.model.topology.sys.ComputerSystem;
import com.collation.platform.model.topology.sys.OperatingSystem;
import com.collation.platform.model.topology.sys.windows.WindowsOperatingSystem;
import com.collation.platform.util.ModelFactory;
import com.collation.proxy.api.client.ApiConnection;
import com.collation.proxy.api.client.ApiException;
import com.collation.proxy.api.client.ApiSession;
import com.collation.proxy.api.client.CMDBApi;
import com.collation.proxy.api.common.AttrNameValue;
import com.ibm.cdb.api.ApiFactory;
import java.io.*;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Vector;

public class ShowAttributes{

        String usage = "Usage: ShowAttributes <hostname> <port> <username> <password> <condition>";
        if (args.length < 6) {
            System.out.println(usage);
            System.exit(1);
        }
        String hostname = args[0];
        int port = Integer.parseInt(args[1]);
        String username = args[2];
        String password = args[3];
        String condition = args[4];
        String extendedAttribute = args[5];

        //We've got our initial arguments. Lets access the TADDM database!
        CMDBApi Api= null;
        ApiSession Session = null;
        ApiConnection Conn = ApiFactory.getInstance().getApiConnection(hostname, port, null, false);
        Session = ApiFactory.getInstance().getSession(Conn, username, password, ApiSession.DEFAULT_VERSION);
        Api = Session.createCMDBApi();

        //We'll extract a list of ComputerSystems
        Query = "SELECT * FROM ComputerSystem where fqdn contains '" + condition + "'";            
        ModelObject mo[] = Api.find(Query, -1, null, null);
        System.out.println("Found " + String.valueOf(mo.length) + " items."); 
       
        //Loop over the list of computers
        for (int j=0; j<mo.length; j++) {   

              //Print out the computer's name
              ComputerSystem computer = (ComputerSystem) mo[j];
              System.out.println(computer.getDisplayName()); 
                                          
              //Extract the list of Extended Attributes for our specific computer
              Guid guid = mo[j].getGuid();
              AttrNameValue[] attrNameValGet = api.getExtendedAttributes(guid);
              //Loop over the list of Extended Attributes  
              for (int jj=0; jj<attrNameValGet.length; jj++) { 
                    
                          System.out.println(">" + attrNameValGet[jj].name + "," + attrNameValGet[jj].value + ","); 

               }

         } 
}

---- End ShowAttributes.java

(This has been cut & pasted without re-double-triple-checking, so please tell me if there are problems)

Now, the problems don't end just with writing the program. How do you compile and run it?
Java being Java, you need a ton of parameters so that the right jar files will be found.
Here's a batch file which compiles our program and runs it.

---- Begin ShowAttributes.bat

@echo off
rem You must set these two to suit your environment.
set COLLATION_HOME=D:\IBM\cmdb\dist
set JAVA_HOME=%COLLATION_HOME%\external\jdk-1.5.0-Windows-i386

rem We will now set TADDM's environment so we can compile java
set path=%path%;%JAVA_HOME%\bin
set TADDM_SDK_HOME=%COLLATION_HOME%\sdk
call %TADDM_SDK_HOME%\bin\setTaddmEnv.bat

echo Compiling ShowAttributes.java
javac -Xlint:deprecation -cp %TADDM_CLASSPATH% -d . ShowAttributes.java
if %errorlevel% neq 0 exit /b
Rem Continue if there were no compiler errors

java -Dcom.collation.home=%COLLATION_HOME% -cp %COLLATION_HOME%\lib\api-client.jar;%COLLATION_HOME%\lib\api-dep.jar;%COLLATION_HOME%\lib\platform-model.jar;. ShowAttributes %1 %2 %3 %4 %5 %6 %7 %8

pause

---- End ShowAttributes.bat

Read more about the TADDM API and other TADDM tricks and tips with the new Redbooks which have just been published.

IBM Tivoli Application Dependency Discovery Manager Capabilities and Best Practices

Deployment Guide Series: IBM Tivoli Application Dependency Discovery Manager V7.1

Have fun!

Thursday, June 5, 2008

Getting on with Greek

This week was the 37th annual conference of The Israel Society for the Promotion of Classical Studies (ISPCS)

My bosses had other ideas about my being there, however.

I only managed to sign up as a member of the ISPCS and purchase a few books to help me with my Greek.
I bought the Joint Association of Classical Teacher's (JAST) series of Reading Greek textbooks.

(There are so many complicated acronyms in the last paragraph that you'd think it was about something in hightech...)

I bought the Grammar, the Reader and the Independent Study guide. I linked to Amazon because the official JACT site is strangely silent about the books. (at least, I haven't found anything)

Anyway, it's now official - I'm spending too much time BUYING Greek books instead of LEARNING Greek!

I've got an exam next Friday - it's a good thing that it's a long weekend here in Israel.