There are occasions where you want to run an agent under a particular userid, and not the one that was used to install the product. The ITM agent for MQ, for example, needs to run under the mqm account and similarly the ITM for DB2 agent must run under the instance owner, otherwise no data is returned. The installer software should allow you to specify the user to execute the agent as during the install, but sometimes it doesn’t, and you may want to change the user further down the line. For Windows agents, this is simply a case of opening the Manage Tivoli Enterprise Monitoring Services console on the server and amending the “Log on as” value. For unix/linux agents, it’s not so straightforward.
While it may be tempting to directly edit the autostart scripts that are put in place by the installer (e.g. /etc/rc.d/init.d/ITMAgents1), any user amendments to this file are overwritten the next time you install another agent, or reconfigure an existing agent on that server:
Sample /etc/rc.d/init.d/ITMAgents1 entries:
/bin/su - root -c " /opt/IBM/ITM/bin/itmcmd agent start sy >/dev/null 2>&1"
/bin/su - db2inst1 -c " /opt/IBM/ITM/bin/itmcmd agent -o db2inst1 start ud >/dev/null 2>&1"
The correct method for *nix servers is to update the $ITMHOME/config/kcirunas.cfg file. This XML-formatted file lists entries for every installed agent and an example file is shipped with the product. Custom entries to this file will be preserved should you perform an action that invokes the UpdateAutoRun.sh script such as a new install or a reconfigure.
While it’s possible to amend this file locally on each server, you can also update the kcirunas.cfg file that’s located in the depot should you have a specific set of userids you want to use for a particular agent across your estate. When remotely deploying the agent with ITM, it will use the amended values from the depot copy of the file.
IBM also supply a handy utility that when installed will allow you to amend the kcirunas.cfg file without having to trawl through the XML yourself. The kciedit utility will allow you to designate the user to run as from a one-off command, or can be incorporated into scripts if required.
./kciedit -t ud -i db2instx -r itmuser add
./kciedit -t mq -i MQM01 -r mqm add
Mark Delaney SYSTEMSMANAGED Ltd