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.

A Fistful of Tools...

Here are two more excellent ITM tools

GBSCMD is a command line tool which was developed in house by Gulfsoft which provides functionality which does not exist in ITM. ITM 6.2 and 6.2FP1 have added more options to tacmd, but GBSCMD is a high bar to reach.

ITMSUPER is a new OPAL offering which allows the user to view managed system data, debug situations, and correct environment configurations.
It basically collects and improves on the existing ITM tools in OPAL which I mentioned here.

You may be able to do your work without these tools, but you're certainly handicapping yourself if you don't take the time to download them and give them a spin!

Monday, June 2, 2008

From Rocket Science to Superstitions...

Here's a cute summary of some superstitions held by those who seem like the most rational people possible - Astronauts and Cosmonauts.

Of course, now I must send you to a site which debunks and refutes every space related superstition.

 

Robert

Sunday, June 1, 2008

Listing Situations and their distributions

If you're like me then you've got customers who want to know "Exactly what is being monitored".
They don't want to go to the portal and check for themselves, nor will they use any of the Tools and Scripts which are available.

They just want the list! And they want it now!
What to do, what to do?
ITM has a very nifty feature in which you can extract data from the system using SOAP web services.

I found the exact commands I needed in the Gulfbreeze Blog and in the OrbData site (All the heavy lifting was done by them).

However, the type of person who needs to display this information is probably rather new to ITM and, lets face it, you've got more important things to do right now than learn a few new out-of-the-way features of ITM.

Gulfbreeze and Orbdata assume you know what you're doing. They also give you the data unformatted - i.e. nothing than can be shown to anyone without a lot of massaging of the information.

I'm going to show the simple, cut & paste way of doing it.
(Appendix A of the ITM Administrator's guide goes into all the gory details.)

  1. In order to run a SOAP request, you need two files
    1. In the bin directory of the TEMS server, create a file called URL.txt which contains the text:
      http://TEMSServerName:1920///cms/soap
    2. In the same directory, create a file called SoapRequest.txt and insert the following text:
      (change userid and password to taste)
    3. <CT_Export>
      <filename>data.xml</filename>
      <request>
      <attach>header-data.xml</attach>
      </request>
      <request>
      <CT_Get>
      <userid>sysadmin</userid><password>mypassword</password>
      <table>O4SRV.LOCALTIME</table>
      <sql>
      SELECT TOBJACCL.OBJNAME,TNODELST.NODE
      FROM O4SRV.TNODELST,O4SRV.TOBJACCL
      WHERE TNODELST.NODELIST=TOBJACCL.NODEL AND TNODELST.NODETYPE="V"
      </sql>
      </CT_Get>
      </request>
      </CT_Export>

  2. In order to see the XML data nicely, you need so insert a reference to an XSL file. Add the file header-data.xml into the cms/html directory with the following content:

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <?xml-stylesheet type="text/xsl" href="kshrpt.xsl"?>
  3. From the bin directory, run the command kshsoap SoapRequest.txt URL.txt (or  CandleSOAPClient on *nix)
  4. You should then find a data.xml file in the cms\html directory. Open it in a web browser and you'll get a nicely formatted table of all the situations and the agents they're associated with.

So what did we do?

We used a CT_Get call to extract the information we wanted. (See the documentation and the other blogs for more details as to what exactly the SELECT does).

We wrapped it in a CT_Export so that we would get an XML file.

We added an attachment to the beginning of the XML file so that we could use the formatting file (which comes with ITM)  to present the information as a proper table and not as an odd looking string.

As I said, the hard part is knowing what SELECT to use, but I hope this little entry will help people.