Monday, January 31, 2011

GbsTask - A Task Management Utility for ITM

Introduction
In Tivoli Management Framework, there is a concept called "Task". Tasks let users to specify executable for a specific platform at the creation time. When a task is run against multiple targets ("endpoints"), the appropriate executable is transferred and executed on the remote system and the output is presented in the standard output. When executed on multiple targets, the execution is done in multi-threaded manner.

We, at Gulf Breeze, developed a Java based solution to implement the task feature in Tivoli Monitoring product and this article discusses about this solution in detail. If you are interested, please email me and I will send you a free copy.

Benefits
  • A Simple database driven tool to create/update/delete/execute tasks.
  • Tasks can be executed on individual OS agents or on ITM MSLs.
  • Tasks can be executed in a multi-threaded manner across agents of different platforms.
  • Supports SQLServer or DB2 databases to store task information.
  • Authorization information kept in a separate file and can be specified with -a switch. You don't need to specify the password in your scripts.
Limitations
  • Maximum number of threads is limited by the maximum number of "tacmd"s that can be run in parallel. Running more than this limit could cause stability issues. As of ITM 6.2.2. FP2, the maximum number of threads is 10.
  • Currently the tasks can be executed only against Windows, Linux and Unix OS agents.
Requirements

To run the "gbstask" solution, you will need the following. The solution is tested with SUN JRE 1.5 and "should" work in other implementations of Java Runtime.
  • JRE 1.5 or later. (The code will NOT work with JRE 1.4).
  • JDBC driver for your database.
  • Tacmd CLI. (The CLI is installed with an OS agent installation or ITM TEMS installation).
  • A SQL Server or DB2 database where you can create a table to contain task information.
Examples

The following command creates task called pingtask for Linux and Windows.
# Creates tasks for Linux and Windows
C:\temp>java -jar GbsTask.jar -a db2.auth -c -l mylib -t pingtask -o Linux -f C:\temp\test.sh
C:\temp>java -jar GbsTask.jar -a db2.auth -c -l mylib -t pingtask -o Windows -f C:\temp\test.bat
# Executes a task on specific managed systems.
$ java -jar GbsTask.jar -a db2.auth -x -l mylib -t pingtask -h Primary:VMTBSM421:NT,vmitm622:LZ,Primary:VMTBSM42X:NT
# Executes a task on specific MSLs.
$ java -jar GbsTask.jar -a db2.auth -x -l mylib -t pingtask -m "*NT_SYSTEM,*LINUX_SYSTEM"
# Deletes a task
$ java -jar GbsTask.jar -a db2.auth -d -l mylib -t pingtask -o Windows
$ java -jar GbsTask.jar -a db2.auth -d -l mylib -t pingtask -o Linux


Sample Output

$ java -jar GbsTask.jar -a db2.auth -x -l mylib -t pingtask -h Primary:VMTBSM421:NT,vmitm622:LZ,Primary:VMTBSM42X:NT
---Begin Task Output for ManagedSystem vmitm622:LZ
PING 192.168.75.21 (192.168.75.21) 56(84) bytes of data.
64 bytes from 192.168.75.21: icmp_seq=1 ttl=128 time=0.276 ms
64 bytes from 192.168.75.21: icmp_seq=2 ttl=128 time=0.255 ms
64 bytes from 192.168.75.21: icmp_seq=3 ttl=128 time=0.168 ms
64 bytes from 192.168.75.21: icmp_seq=4 ttl=128 time=0.221 ms
--- 192.168.75.21 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3000ms
rtt min/avg/max/mdev = 0.168/0.230/0.276/0.040 ms
---End Task Output for ManagedSystem vmitm622:LZ
---Begin Task Output for ManagedSystem Primary:VMTBSM421:NT
C:\WINDOWS\system32>ping 192.168.75.21
Pinging 192.168.75.21 with 32 bytes of data:
Reply from 192.168.75.21: bytes=32 time=1ms TTL=128
Reply from 192.168.75.21: bytes=32 time=1ms TTL=128
Reply from 192.168.75.21: bytes=32 time=1ms TTL=128
Reply from 192.168.75.21: bytes=32 time=1ms TTL=128
Ping statistics for 192.168.75.21:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
---End Task Output for ManagedSystem Primary:VMTBSM421:NT
---Begin Task Output for ManagedSystem Primary:VMTBSM42X:NT
C:\WINDOWS\system32>ping 192.168.75.21
Pinging 192.168.75.21 with 32 bytes of data:
Reply from 192.168.75.21: bytes=32 time=1ms TTL=128
Reply from 192.168.75.21: bytes=32 time=1ms TTL=128
Reply from 192.168.75.21: bytes=32 time=1ms TTL=128
Reply from 192.168.75.21: bytes=32 time=1ms TTL=128
Ping statistics for 192.168.75.21:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
---End Task Output for ManagedSystem Primary:VMTBSM42X:NT

Interested?
Interested? Please email me at venkat at gulfsoft.com and will send you a free copy of this tool. You can download the documentation for this tool from the link below.

No comments: