Friday, March 7, 2008

Introduction to the tacmd

In ITM 6.1 the tacmd is your new Swiss army knife. The tacmd interacts with an ITM 6.1 SOAP server to perform tasks. By default that will be your HUB TEMS server within your ITM 6.1 infrastructure. Most tacmd functions require operating system authentication using the 'tacmd login' command. By default if you have not configured your SOAP server with userid the "tacmd login" really doesn't authenticate (see my blog entry about this "Having more fun with the tacmd" for more details.)

In general functions that can be performed with the tacmd can be summarized into two categories:

  • Agent Functions

  • Situation Functions

  • In this part of the article we will discuss the agent deployment and agent administration functions. The second part in another article will cover "Situation Functions".

    For a frame of reference for this article this table describes my lab environment.

    Server Function
    gbs100 HUB TEMS
    gbs101 Remote TEMS
    gbs102 Remote TEMS
    gbs300 Unix OS Agent/Universal Agent

    Before you can perform most of the tacmd functions you must login (i.e., authenticate). There are two commands for logging in and out:

    tacmd login

    tacmd logout

    For example:

    tacmd login -s gbs100 -u gbs01 -p password -t 1440

    The "-s" is the TEMS server name. The "-t" is a time out value for the login. The default timeout is 15 minutes and that becomes a pain in the neck having to authenticate every 15 minutes. I just set the login with the max timeout value of 14440 (i.e., 24 hours) just to make my life easier. There are no parameters for the logout. Also if you don't specify the password in the command it will prompt you for one.

    Agent Deployment and Administration Functions

    There are a number of different ways to deploy agents in ITM 6.1. However since this article is focused on the tacmd we will only discuss how to use the tacmd for agent deployment. In order to use the tacmd to deploy agents you have to first populate an agent depot with bundles. An agent depot is an installation depot on the TEMS that contains all the different agent packages you plan on deploying. In order to load theses packages into the agent depot you need to add bundles to the depot. A bundle is a copied installation image that has been added to the depot via the tacmd. For those of you familiar with the TME product called SIS, the concept is similar. First you load all the possible products for the different platforms that you might need to deploy into the depot. Then you can deploy the agent over and over again without having to locate the install image every time. In this case the components are the agent installation images. One of the first commands you might want to run is the "tacmd viewdepot" to see what is already in the depot.

    From a TEMS server issue:

    tacmd viewdepot

    The next step in the process is to add the bundles to your agent depot. To do this you have to locate your ITM 6.1 install images. You can use the "tacmd listbundles" to see what agent bundles are available in the installation images. The agent depot needs to be loaded with all the bundles you plan on deploying to machines using th tacmd. For example, if you want to deploy a Linux OS Agent from a TEMS that is a Windows machine you will have to locate the Linux install image that contains the Linix OS agent and add the bundle to the depot before deploying it. This is where the "tacmd listbundles" command comes in handy because it tells you what bundles are in a specific install image. If you wanted to add all bundles from the ITM 6.1 Unix install image you could do the following command:

    tacmd addBundles -i /mnt/unix

    The "/mnt/unix" would be the installation image directory. The default depot location on Unix is located in /tables//depot directory. This can be changed by changing the DEPOTHOME variable in the KBBENV file on your TEMS.

    The next step in the ITM 6.1 agent deployment process, using the tacmd, is to create a node. A node in ITM 6.1 is somewhat similar to the endpoint concept in TME. It is the component that has to be created first in order to deploy any of the other software to the machine. The big difference between an ITM 6.1 node and a TME endpoint is that not only does the ITM 6.1 node include the infrastructure (i.e., directories, agent code, etc) for the agent it also includes the base OS monitoring. Whereas, a TME endpoint install only has the infrastructure components and the OS Monitoring needs to be deployed in a subsequent step. The node is sometimes also referred to as the OS Agent. It includes the agent code, infrastructure, and the OS monitoring, and data collection. The "tacmd createnode" command is used to create a node. The "tacmd createnode" command can use the SSH, REXEC, or RSH protocols on Unix/Linux and it uses SSH or SMB on Windows. The following is an example of how I installed the OS Agent on one of my AIX 5.x systems:

    tacmd createNode -h gbs300 -u root -d /opt/IBM/ITM -p KEY=IBMTivoliMonitoringEncryptionKey PROTOCOL1=IP.PIPE PORT=1918 SERVER=gbs101 BSERVER=gbs102 BPROTOCOL=IP.PIPE PORT=1918

    By default the agent will connect to the TEMS from where you invoke the "tacmd createnode" command. In my example I was creating the node from my HUB TEMS but I wanted the agent to connect to one of my RTEMS. I also want the agent to connect to another RTEMS as a failover. I used the SERVER and BSERVER to define the primary and secondary RTEMS. The PROTOCAL and BPROTOCAL are setup to use TCP/IP (i.e., IP.PIPE). I have a detailed BLOG entry called "A day in the life of an ITM 6.1 install" that goes into more detail about architecture decisions like this. The short story on this example is that the node is being created to connect to a RTEMS host called gbs101 and connect to an alternative RTEMS called gbs102 if gbs101 is not available. Sound familiar? It's kind of like endpoints and gateways. After the node is successfully created it will automatically start monitoring the system for OS metrics and it will also start running all of the default OS Agent situations.

    After the OS Agent is deployed you can add systems (i.e., NON OS agents) with the "tacmd addsystem" command. If you want to further deploy other agents (e.g., DB2, Oracle, MSSQL, etc.) you then add any non OS Agents by using the "tacmd addsystem" command. You can also use the "tacmd addsystem" to add Universal Agents. The following command is an example of how to install a Universal Agent:

    tacmd addsystem -t um -n gbs300:KUX -p UA.CONFIG="pagespace.mdl"

    The "-t um " specifies the Universal Agent. The "-n" needs to specify the managed system name (the fully qualified system name of the OS agent). From the TEMS you can run the "tacmd listsystems" to get the agent names. In my example I ran the "tacmd listsystems" from my gbs101 RTEMS. The "-p" command allows you specify parameters for the agent deployment. In this example I want to load a metafile called pagespace.mdl for a script based Universal Agent. You can load your metafiles in your agent depot and the "tacmd addsystem" will deploy the metafile to the agent. In this example I had to create a UACONFIG directory in the agent depot on gbs101 (e.g., /opt/IBM/ITM/tables/hub_gbs101/depot/UACONFIG). In the example the '-p UA.CONFIG="pagespace.mdl"' will pull the metafile from the UACONFIG directory and install that file on the target node (i.e., gbs300).

    You can also use the tacmd to manage the administration of an agent. The tacmd has the startagent, stopagent, and restartagent an agent functions. You can also use the tacmd to update an agent using the "tacmd updateagent". This can be used install agent updates.

    No comments: