<HTML>
<HEAD>
<TITLE>Re: [hobbit] NFS and shared clientlaunch.cfg files</TITLE>
</HEAD>
<BODY>
<FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'><BR>
Thanks for the tips guys, much obliged!<BR>
<BR>
Mike<BR>
<BR>
On 8/16/07 12:49 PM, "Daniel Bourque" <dbourque@weatherdata.com> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>sup pimp ! nice to see you here.<BR>
<BR>
you idea should work good, it would keep all machines from needlessly starting a script that justs exit. Thing is you'll have to create a clientlaunch.cfg file or simlink to the default one for each machine running hobbit. <BR>
<BR>
Another Idea , similar to Charle Jone's idea, is to launch a wrapper script from clientlaunch.cfg. A wrapper called mycheck just looks for a script named mycheck.$BBHOSTNAME, exec's it if it exists or exits with 0.<BR>
<BR>
more than one way to skin a cat , hobbit's like the swiss army of knife of system monitoring :)<BR>
<BR>
<BR>
-Dan<BR>
<BR>
Charles Jones wrote: <BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>  I encountered this exact problem, with monitoring a few hundred servers that had a common NFS filesystem. For the most part, Hobbit handles this gracefully as it uses unique names for logfiles and such. I ran into problems though when I wanted an extra script to run, but just on certain hosts. I ended up just having the ext script check the hostname and exit gracefully if it was not the host it should run on:<BR>
 </SPAN></FONT><FONT SIZE="1"><FONT FACE="Monaco, Courier New"><SPAN STYLE='font-size:9.0px'>HOSTNAME=`/bin/hostname`<BR>
 <BR>
if ! echo $HOSTNAME | egrep -q 'app-28|web-12|web-13|db-10' ; then<BR>
   exit 0<BR>
fi<BR>
 <BR>
</SPAN></FONT></FONT><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>What I would really like to see (and I posted this on the list before), is a server-side configuration of what scripts or even commands to run on the remote hosts. I doubt this will be implemented though, because too many people view it as a security risk.  What I proposed was a config file with a format something like:<BR>
 <BR>
<hostname> <script path> <interval><BR>
example:<BR>
host1.domain.com /home/hobbit/client/ext/somescript.sh 5m<BR>
 <BR>
The above would instruct the hobbit client on host1.domain.com to run the somescript.sh every 5 minutes.<BR>
 <BR>
Another way to do it is just use cron and run the script via bbcmd, but I dont like things that run with hobbit to be able to run when Hobbit is not running (if I have the client down for some reason, the cron would still kickoff unless I also disabled it).<BR>
 <BR>
-Charles<BR>
 <BR>
 <BR>
Michael Dunne wrote: <BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'> <BR>
Greetings fellow Hobbit-ers,<BR>
<BR>
I was recently tasked with monitoring 100+ solaris systems. Feeling undaunted I reached into <BR>
my trusty IT toolbox and pulled out one of my favorite tools, Hobbit. What I encountered is <BR>
as followed. <BR>
<BR>
The systems utilize NFS mounted directories. I installed the client files into /usr/local/<BR>
hobbit/client and voila! they were available to all of my systems. The issue that I encountered <BR>
was that I wished to run different external scripts per client, but with a "shared" clientlaunch <BR>
file I could not see how to do this. (This is where I cringe as I suspect that my solution is <BR>
rather naive) What I would up doing is modifying the runclient.sh file as reflected below:<BR>
<BR>
<BR>
~/client hobbit$ diff runclient.sh runclient.ren <BR>
79c79<BR>
<               $0 --hostname="$MACHINEDOTS" stop<BR>
---<BR>
  <BR>
 <BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'> <BR>
              $0 stop<BR>
    <BR>
 <BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'> <BR>
83c83<BR>
<       $HOBBITCLIENTHOME/bin/hobbitlaunch --config=$HOBBITCLIENTHOME/etc/<BR>
clientlaunch.cfg --log=$HOBBITCLIENTHOME/logs/clientlaunch.log --pidfile=<BR>
$HOBBITCLIENTHOME/logs/clientlaunch.$MACHINEDOTS.pid<BR>
---<BR>
  <BR>
 <BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'> <BR>
      $HOBBITCLIENTHOME/bin/hobbitlaunch --config=$HOBBITCLIENTHOME/etc/<BR>
    <BR>
 <BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'> <BR>
$MACHINEDOTS.clientlaunch.cfg --log=$HOBBITCLIENTHOME/logs/<BR>
$MACHINEDOTS.clientlaunch.log --pidfile=$HOBBITCLIENTHOME/logs/clientlaunch.<BR>
$MACHINEDOTS.pid<BR>
102c102<BR>
<               $0 --hostname="$MACHINEDOTS" stop<BR>
---<BR>
  <BR>
 <BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'> <BR>
              $0 stop<BR>
    <BR>
 <BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'> <BR>
107c107<BR>
<       $0 --hostname="$MACHINEDOTS" --os="$BBOSTYPE" start<BR>
---<BR>
  <BR>
 <BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'> <BR>
      $0 start<BR>
    <BR>
 <BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'> <BR>
My questions are as followed. <BR>
<BR>
Has anyone encountered this specific issue before, and if so how did you address it?<BR>
Does my, admittedly inelegant, solution pose any issues in relation to long term use? <BR>
<BR>
I searched the list and was unable to find anything specific to my issue. <BR>
<BR>
<BR>
Thanks in advance for reading this missive.<BR>
<BR>
<BR>
Best regards,<BR>
<BR>
Mike<BR>
<BR>
To unsubscribe from the hobbit list, send an e-mail to<BR>
hobbit-unsubscribe@hswn.dk<BR>
  <BR>
 <BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'> <BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'><BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'><BR>
<BR>
</SPAN></FONT>
</BODY>
</HTML>