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

Haertig, David F (Dave) haertig at avaya.com
Mon Jun 11 22:25:11 CEST 2007


Thanks for the reply.  Looks like my previous post and yours just
crossed.  as you were emaling, I was looking at logfetch.c and finding
out for myself exactly what you it is you were saying.

"... addon ... Does that sound ok ?"

You don't have to add a new feature just for me!  You do enough work on
this fantastic product!  (Do you ever sleep???!!!)

It might not be a terribly involved addition, I'd just hack into that
existing logfetch.c code and dummy up the call that tells it to process
the file from the beginning if the logfiles size has shrunk.

Thanks!

-----Original Message-----
From: Henrik Stoerner [mailto:henrik at hswn.dk] 
Sent: Monday, June 11, 2007 2:14 PM
To: hobbit at hswn.dk
Subject: Re: [hobbit] How to run an arbitary script on the client end?

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


To unsubscribe from the hobbit list, send an e-mail to
hobbit-unsubscribe at hswn.dk



More information about the Xymon mailing list