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
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
On Fri, Jul 28, 2006 at 11:12:21PM -0700, Charles Jones wrote:
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?
As long as it has a header with the same identifier for where the commandline is, then it should work.
Regards, Henrik
Henrik,
I'm not sure what you mean by the header. I assume you mean the column headings on normal ps output: $ ps aux |head -1 USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
It appears that the command line ps options that I want to use, drastically change the column header: $ ps -welfm |head -1 F S UID PID PPID C PRI NI ADDR SZ WCHAN STIME TTY TIME CMD
Will hobbit handle this? If not, can I hack it to make it do so? If I have to I suppose I could use a shell script wrapper for ps that wiill spoof a header that the client is expecting.
-Charles
From: Henrik Stoerner [mailto:henrik at hswn.dk] Sent: Fri 7/28/2006 11:59 PM To: hobbit at hswn.dk Subject: Re: [hobbit] RE: [Hobbit] Using variables in clientlaunch.cfg?
On Fri, Jul 28, 2006 at 11:12:21PM -0700, Charles Jones wrote:
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?
As long as it has a header with the same identifier for where the commandline is, then it should work.
Henrik,
FYI I just tried adding the m flag, and it works beautifully:
I changed hobbitclient-linux.sh. Before: ps -Aw -o pid,ppid,user,start,state,pri,pcpu,time,pmem,rsz,vsz,cmd After: ps -Awm -o pid,ppid,user,start,state,pri,pcpu,time,pmem,rsz,vsz,cmd
All proc checks seem to work as normal, and with the m flag I am now able to use TRACK on process threads (which are normally not displayed).
Thanks for making Hobbit so flexible! -Charles
From: Charles Jones -X (charljon - Cisco Learning Institute at Cisco) Sent: Sat 7/29/2006 12:41 AM To: hobbit at hswn.dk Subject: RE: [hobbit] RE: [Hobbit] Using variables in clientlaunch.cfg?
Henrik,
I'm not sure what you mean by the header. I assume you mean the column headings on normal ps output: $ ps aux |head -1 USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
It appears that the command line ps options that I want to use, drastically change the column header: $ ps -welfm |head -1 F S UID PID PPID C PRI NI ADDR SZ WCHAN STIME TTY TIME CMD
Will hobbit handle this? If not, can I hack it to make it do so? If I have to I suppose I could use a shell script wrapper for ps that wiill spoof a header that the client is expecting.
-Charles
From: Henrik Stoerner [mailto:henrik at hswn.dk] Sent: Fri 7/28/2006 11:59 PM To: hobbit at hswn.dk Subject: Re: [hobbit] RE: [Hobbit] Using variables in clientlaunch.cfg?
On Fri, Jul 28, 2006 at 11:12:21PM -0700, Charles Jones wrote:
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?
As long as it has a header with the same identifier for where the commandline is, then it should work.
On Fri, Jul 28, 2006 at 04:02:45PM -0700, Charles Jones wrote:
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
It can. Any environment variable, or setting from the hobbitclient.cfg file, can be used in the settings in clientlaunch.cfg.
I imagine this method though would generate errors when hobbit tries to execute the script on the hosts where it does not exist?
It would, but after 5 attempts it would automatically disable the task.
Henrik
My goal is to script the configure process without interactive answering options.
Following line still won't cut it.
./configure --server --fping /opt/local/fping22/sbin/fping --rrdinclude /opt/local/rrdtool12/include --rrdlib /opt/local/rrdtool12/lib --pcreinclude /opt/local/libpcre44/include --pcrelib /opt/local/libpcre44/lib --sslinclude /opt/local/libopenssl097/include --ssllib /opt/local/libopenssl097/lib --ldapinclude /opt/local/openldap2127/include --ldaplib /opt/local/openldap2127/lib
build/fping.sh still asking question. I modified fping.sh to slience the question prompt but then ssl and ldap question keep coming.
ls build/*.sh
build/allinone.sh build/fping.sh build/ldap.sh
build/makehtml.sh build/pedanticcheck.sh
build/bb-commands.sh build/genconfig.sh build/lfs.sh
build/makerpm.sh build/rrd.sh
build/dorelease.sh build/generate-md5.sh build/makedeb.sh build/pcre.sh
build/ssl.sh
Henrik,
Can you modify the related scripts to provie trully non-ineractive configure process ?
T.J. Yang
On Sat, Jul 29, 2006 at 09:21:12AM -0500, T.J. Yang wrote:
Can you modify the related scripts to provie trully non-ineractive configure process ?
See the "configure" commands in the debian/rules file. You can do some things with configure options, but the really simple way of doing a non-interactive build is through environment variables passed to the configure script. E.g. (from the debian/rules file):
USEHOBBITPING=y \
ENABLESSL=y \
ENABLELDAP=y \
ENABLELDAPSSL=y \
BBUSER=hobbit \
BBTOPDIR=/usr/lib/hobbit \
BBVAR=/var/lib/hobbit \
BBHOSTURL=/hobbit \
CGIDIR=/usr/lib/hobbit/cgi-bin \
BBCGIURL=/hobbit-cgi \
SECURECGIDIR=/usr/lib/hobbit/cgi-secure \
SECUREBBCGIURL=/hobbit-seccgi \
HTTPDGID=www-data \
BBLOGDIR=/var/log/hobbit \
BBHOSTNAME=localhost \
BBHOSTIP=127.0.0.1 \
MANROOT=/usr/share/man \
INSTALLBINDIR=/usr/lib/hobbit/server/bin \
INSTALLETCDIR=/etc/hobbit \
INSTALLWEBDIR=/etc/hobbit/web \
INSTALLEXTDIR=/usr/lib/hobbit/server/ext \
INSTALLTMPDIR=/var/lib/hobbit/tmp \
INSTALLWWWDIR=/var/lib/hobbit/www \
./configure
Regards, Henrik
From: henrik at hswn.dk (Henrik Stoerner) Reply-To: hobbit at hswn.dk To: hobbit at hswn.dk Subject: Re: [hobbit] please enable non-interactive configure Date: Sat, 29 Jul 2006 16:43:15 +0200
On Sat, Jul 29, 2006 at 09:21:12AM -0500, T.J. Yang wrote:
Can you modify the related scripts to provie trully non-ineractive configure process ?
See the "configure" commands in the debian/rules file. You can do some things with configure options, but the really simple way of doing a non-interactive build is through environment variables passed to the configure script. E.g. (from the debian/rules file):
USEHOBBITPING=y \This is what I missed, once I set "USEHOBBITPING=n", the external fping got accepted. Thanks.
tj
Looks like even I specify "configure --server ...', "gmake install" also generate client binaries.
Am I doing somthing wrong ?
T.J. Yang
On Sat, Jul 29, 2006 at 11:21:44AM -0500, T.J. Yang wrote:
Looks like even I specify "configure --server ...', "gmake install" also generate client binaries.
Am I doing somthing wrong ?
Client binaries are always built. Even on a Hobbit server, you'd probably want to run the client-side tools as well.
Henrik
From: henrik at hswn.dk (Henrik Stoerner) Reply-To: hobbit at hswn.dk To: hobbit at hswn.dk Subject: Re: [hobbit] how to only generate server or client binaries ? Date: Sat, 29 Jul 2006 21:45:25 +0200
On Sat, Jul 29, 2006 at 11:21:44AM -0500, T.J. Yang wrote:
Looks like even I specify "configure --server ...', "gmake install" also generate client binaries.
Am I doing somthing wrong ?
Client binaries are always built. Even on a Hobbit server, you'd probably want to run the client-side tools as well.
Henrik
Henrik Thanks for the reply.
I am interested to replace my bb deployment with hobbit one. I need to create hobbit server (for linux)and client packages(for solaris,hpux,linux).
May I suggest that in the future split the server and client binaries in a more cleaner way(IMHO). configue as server should only generate server binaries. if one want client binary we then run "configure --client" to get it. For now I can get by deleting /opt/local/hobbit/client directory after server install.
Also is it possible that you can have client and server reside at same level as hobbit ? like /opt/local/hobbits( for server) and /opt/local/hobbitc (for client). the will make packaging more streightforwad to deal with removal of client installation path.
My idea installation path structure is like this
/opt/local/hobbits -bin -man -doc -web -www -etc
/opt/local/hobbitc -bin -man -doc -etc
Again just my person opinion.
Regards
tj
T.J. Yang wrote:
On Sat, Jul 29, 2006 at 11:21:44AM -0500, T.J. Yang wrote:
Looks like even I specify "configure --server ...', "gmake install"
also
generate client binaries.
Am I doing somthing wrong ?
Client binaries are always built. Even on a Hobbit server, you'd probably want to run the client-side tools as well.
Henrik
Henrik Thanks for the reply.
I am interested to replace my bb deployment with hobbit one. I need to create hobbit server (for linux)and client packages(for solaris,hpux,linux).
Packages of various versions for the above platforms can be found here: http://www.razorsedge.org/~mike/software/hobbit/
-- -m
... so long as the people do not care to exercise their freedom, those who wish to tyrranize will do so; for tyrants are active and ardent, and will devote themselves in the name of any number of gods, religious and otherwise, to put shackles upon sleeping men. -- Voltarine de Cleyre
T.J. Yang wrote:
On Sat, Jul 29, 2006 at 11:21:44AM -0500, T.J. Yang wrote:
Looks like even I specify "configure --server ...', "gmake install"
also
generate client binaries.
Am I doing somthing wrong ?
Client binaries are always built. Even on a Hobbit server, you'd probably want to run the client-side tools as well.
Henrik
Henrik Thanks for the reply.
I am interested to replace my bb deployment with hobbit one. I need to create hobbit server (for linux)and client packages(for solaris,hpux,linux).
Packages of various versions for the above platforms can be found here: http://www.razorsedge.org/~mike/software/hobbit/
-- -m
... so long as the people do not care to exercise their freedom, those who wish to tyrranize will do so; for tyrants are active and ardent, and will devote themselves in the name of any number of gods, religious and otherwise, to put shackles upon sleeping men. -- Voltarine de Cleyre
participants (6)
-
Charles.Jones@ciscolearning.org
-
charljon@cisco.com
-
henrik@hswn.dk
-
hobbit@razorsedge.org
-
mike@razorsedge.org
-
tj_yang@hotmail.com