[hobbit] How to run an arbitary script on the client end?

Henrik Stoerner henrik at hswn.dk
Mon Jun 11 22:13:31 CEST 2007


On Mon, Jun 11, 2007 at 07:28:21AM -0600, Haertig, David F (Dave) wrote:
> Thanks for that info.  I'll try sticking the date in the logfile to give
> it unique contents, and see it that works.
> 
> log:`date >/tmp/dirMon.out; /tmp/dirMon.ksh 2>&1 >>/tmp/dirMon.out; echo
> /tmp/dirMon.out`:1000 
> 
> p.s. - It looks like I'm trying to win "The best abuse of an unintended
> 'feature' award" with this hack.  Wish me luck!  ;-)

You're obviously doing your best to get that award. If you persist,
I might even make it official :-)


The problem you're having is that Hobbit's log monitoring tries very
hard to send only the new log entries across to the Hobbit server. So it
stores the size that the logfile has from one client cycle to the next,
and only the data that is appended is actually transferred.

So if you were continuously appending data to the logfile, it would 
probably work the way you wanted it to. I.e. you should have

   log:`date >>/tmp/dirMon.out; ...

where you append data instead of truncating the dirMon.out file with
each run of the client. 

It's OK to truncate the file once in a while, as long as Hobbit can see 
that the new file is smaller than the old one it should work. My guess is 
that the file doesn't change in size from one cycle to the next, and
then Hobbit considers it to be unchanged and doesn't send any data.


I suppose it might be an idea to have the possibility of having "add-on"
modules to the Hobbit client, which you can control through the
client-local.cfg file. So a new feature for the Hobbit client would be
to support something like
   addon:/usr/local/bin/myHobbitAddon.sh:foo
which would run the myHobbitAddon.sh script and put the output into a 
[foo] section in the client data. Does that sound ok ?


Regards,
Henrik




More information about the Xymon mailing list