[Hobbit] Using variables in clientlaunch.cfg?

Charles Jones Charles.Jones at ciscolearning.org
Sat Jul 29 08:12:21 CEST 2006


I just thought of another way to do this. I could modify the ps arguments that hobbit uses, and then just use hobbit-client.cfg with the PROC and TRACK options, and then I won't have to deal with using an ext script at all.

$ ps -welfm |egrep '(java.+tc_1_1)'|grep -v grep |wc -l
     66

The "m" flag shows all sub processes/threads. Without it, it would only show a single java process.

So this would work, but the question is, would hobbit still correctly parse the ps output with those flags? Here is a sample of the output using these flags:

$ ps -welfm |egrep '(java.+tc_1_1)'|grep -v grep | tail -1
1 S myuser   1664     1  0  76   0    - 365538 -     06:05 pts/0    00:00:00 /apps/someapp/java/j2sdk1.4.3/bin/java -server -XX:PermSize=256m -XX:NewSize=256m -Xms1024m -Xmx1024m -verbose:gc -Xloggc:/apps/someapp/tomcat/tc_1_1/logs/gc.log -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -Djava.endorsed.dirs=/apps/someapp/tom

-Charles
-----Original Message-----
From: Charles Jones
Sent: Fri 7/28/2006 4:02 PM
To: hobbit at hswn.dk
Subject: Using variables in clientlaunch.cfg?
 
I plan on making some custom graphs for things like tomcat thread counts. The documentation for creating custom graphs should get me through that part, but the problem is my environment is such that groups of my monitored servers share a common home directory.

Fortunately, the hobbitclient uses the hostname as part of most of its dynamic files, so there are no conflicts.

The problem I forsee is lets say that servers 1-10 all share a common client homedirectory (SAN mount). Lets say that I want to collect data on tomcat thread counts on just some of the servers. I cannot just add an entry to clientlaunch.cfg, as this will affect ALL the servers.

Can you suggest how I should handle this?

The only way I can think of, is to define a generic "launcher" script, like:

[launcher]
        	ENVFILE /home/hobbit/client/etc/hobbitclient.cfg
                CMD /home/hobbit/client/ext/launcher.sh
                INTERVAL 5m


This launcher.sh script could do something like:
------------------------------------------------------------------------------
#!/bin/sh
if [ -f /home/hobbit/client/ext/$HOSTNAME_tct.sh ]
then
      /home/hobbit/client/ext/$HOSTNAME_tct.sh
fi
------------------------------------------------------------------------------
This would launch an external script that matched the hostname, if it existed, otherwise does nothing. This would allow all of the custom ext scripts to be in the same shared directory, with different names.


Another option would be, if clientlaunch could handle variables:
------------------------------------------------------------------------------
[tomcat_threads]
        	ENVFILE /home/hobbit/client/etc/hobbitclient.cfg
                CMD /home/hobbit/client/ext/$HOSTNAME_tct.sh
                INTERVAL 5m
------------------------------------------------------------------------------
I imagine this method though would generate errors when hobbit tries to execute the script on the hosts where it does not exist?

-Charles

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20060728/7e3d6a18/attachment.html>


More information about the Xymon mailing list