Wednesday, November 12, 2008

Scripts to start the TPAP components

These are the scripts used to start the TPAP (CCMDB, TAMIT) components:

startmw.sh
su - db2inst1 -c "db2start"
su - ctginst1 -c "db2start"
su - idsccmdb -c "db2start"
/opt/ibm/ldap/V6.1/sbin/32/ibmdiradm -I idsccmdb
/opt/ibm/ldap/V6.1/sbin/32/ibmslapd -I idsccmdb

startwas.sh
/opt/IBM/WebSphere/AppServer/profiles/ctgDmgr01/bin/startManager.sh
/opt/IBM/WebSphere/AppServer/profiles/ctgAppSrv01/bin/startNode.sh
/opt/IBM/WebSphere/AppServer/profiles/ctgAppSrv01/bin/startServer.sh MXServer

stopwas.sh
/opt/IBM/WebSphere/AppServer/profiles/ctgAppSrv01/bin/stopServer.sh MXServer -username wasadmin -password itsmswat
/opt/IBM/WebSphere/AppServer/profiles/ctgAppSrv01/bin/stopNode.sh -username wasadmin -password itsmswat
/opt/IBM/WebSphere/AppServer/profiles/ctgDmgr01/bin/stopManager.sh -username wasadmin -password itsmswat

stopmw.sh
/opt/ibm/ldap/V6.1/sbin/32/ibmslapd -k idsccmdb
/opt/ibm/ldap/V6.1/sbin/32/ibmdiradm -k idsccmdb
su - db2inst1 -c "db2stop force"
su - ctginst1 -c "db2stop force"
su - idsccmdb -c "db2stop force"

Monday, November 10, 2008

Explaining the Initialization mode in a TDI Loop

Very often with TDI, it's necessary to put a Loop in an Assembly Line, so that the Work Entries from the Feed can be used to perform another query to retrieve some data. An example is with Tivoli Application Depdendency Discovery Manager (TADDM) and obtaining all IP addresses for a ComputerSystem. The IP addresses are attributes of the IpAddress object, which is related to an IpInterface, which is then related to a ComputerSystem object, so in order to retrieve the IP addresses of a Computer System we need to correlate ComputerSystem, IpInterface and IpAddress.

To do that using TDI (avoid the need to process XML files or write Java code), we can use the TADDM Connector, available at: Tivoli OPAL

As the TADDM Connector allows to specify the depth of the query, our first inclination is specify depth=3, which would directly return all attributes from the ComputerSystems and related object in just one shot. This approach is great and simple, but puts a lot of work on TDI (and TADDM server) to retrieve all attributes of depth 3, which can easily turn to be thousands, for each Computer System. For an environment containing about 2500 servers, it took 15 minutes to retrieve the IP addressses and dump them in a very simple Assembly Line.

A second option is to read only the attributes of ComputerSystem (at depth 1), then put a Loop to retrieve the IpInterfaces, linking them to the ComputerSystem and reading at depth 2. The Assembly Line is a little bit more complicated, and the main problem is that the AL takes 36 minutes, instead of the previous version.

The reason for this performance degradation is the fact that TDI is re-initializing the connection to TADDM for every single ComputerSystem. Looking at the Loop, by default TDI uses Initialize and Select/Lookup as the Init Options, which means that the Connector is initialized every time. Changing it to Select / Lookup only leads to a running time of mere 6 minutes!

So take good care of your TDI Loop!

Eddie, so far no JavaScript code!

Friday, November 7, 2008

Splitting multi-valued variables in TDI

In many cases, we have an entry with multiple values (separated by comma, for example), and we need to split those values and process one at a time.

Assuming there is an entry with the following values:

10.4.128.24, 10.4.128.160, 10.4.128.161, 10.4.128.220, 10.4.128.227, 10.4.128.229, 10.4.128.231, 10.4.128.232, 10.4.128.209, 10.4.129.24

Here are the steps to process each value at a time:

  • In your AL, add a script component with the following code
    multiValued = work.getString ("MultiValued");

    task.logmsg ("multi valued: " + multiValued);

    tokenizer = new java.util.StringTokenizer (multiValued, ",");
    work.setAttribute ("values", null);

    while (tokenizer.hasMoreTokens ()) {
    token = tokenizer.nextToken ();
    task.logmsg ("value: " + token);
    work.addAttributeValue ("values", token);

    }
  • Add a Loop to your AL
  • In the Loop, select Attribute Value Loop
  • In the Work Attribute Name, type values (which matches the Work Entry defined in the code above)
  • In the Loop Attribute Name, type value
  • Inside the loop, you'll have the value Work Entry with a single value to process.
That's it!

Thursday, November 6, 2008

Script to launch ABBA with TADDM 7.1.2

TADDM 7.1.2 is coming soon, and the JAR files for the TADDM API have been consolidated into just one JAR (no comments on backward compatibility...). The tool works with TADDM 7.1.2; we just need to change the required JAR files, so here is a script to launch it with the new version:

export TADDM_SDK=/home/eduardo/Tivoli/TADDM/712/sdk/clientlib
java -cp bin/abba.jar:$TADDM_SDK/taddm-api-client.jar com.ibm.cmdb.tool.abba.ABBAGUI $*

By the way, this incredible tool can be downloaded from: http://www-01.ibm.com/software/brandcatalog/portal/opal/details?catalog.label=1TW10TA0X