[hobbit] Hobbit client executing a script to be proactive if a problem occurs?

Phil Wild philwild at gmail.com
Tue Apr 15 04:04:18 CEST 2008


Hi Chris,

As far as I know, you would need to use a SCRIPT line in hobbit-alerts. The
example that Henrik gave is quite simple and I would be very careful about
how you use it... For example, if you run a backup, or a one off job that
does something CPU intensive that would not be considered a fault, yet it
did trigger a CPU threshold breach, you may actually triger an event that
kills and restarts a perfectly healthy process.

Your best approach is to see if there is something that is very unique about
your problem and build a test around it, for example, use ps or top to give
you the process using the most cpu, if that process is your usual suspect
and cpu usage is greater than 80% and it has been that way for five minutes,
then take an action and report up to hobbit that an action has been taken...

Cheers

Phil

2008/4/15 Chris Wopat <chrisw at supranet.net>:

> Henrik Stoerner wrote:
>
> > On Fri, Apr 11, 2008 at 08:56:02AM -0500, Chris Wopat wrote:
> >
> > > Is there a cleaner way built in that will just say "if service FOO is
> > > red then on client run script ext/BAR.sh"?
> > >
> >
> > There is. You use the Hobbit "query" command to probe the status, and
> > then act accordingly. To use your example with the "cpu" status going
> > red:
> >
> >   #!/bin/sh
> >
> >   CPUCOLOR=`$BB $BBDISP "query $MACHINE.cpu" | awk '{print $1}'`
> >   if test "$CPUCOLOR" = "red"
> >   then
> >       # Kill some cpu hogging processes
> >       .... whatever it takes ....
> >   fi
> >   exit 0
> >
> > The "query" command returns the first line of the current status, and
> > the first word is the current color. You probably will want to put in
> > some sort of sanity check so you don't trigger this too often. Or
> > perhaps just log the fact that it triggered.
> >
>
> Excellent, was unaware of this query feature. The script above looks like
> it would perfectly deal with my situation if I were to put it in cron on the
> client machine, which may be suitable.
>
> Is there some way to tell the hobbit server to execute this script on the
> client, or would something in a SCRIPT line in a hobbit alert, likely using
> ssh keys, be the only way?
>
> --Chris
>
>
> To unsubscribe from the hobbit list, send an e-mail to
> hobbit-unsubscribe at hswn.dk
>
>
>


-- 
Tel: 0400 466 952
Fax: 0433 123 226
email: philwild AT gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20080415/2d5f3a51/attachment.html>


More information about the Xymon mailing list