[hobbit] Extend timers to avoid purples

Andy France Andy at zespri.com
Tue Jun 28 00:39:48 CEST 2005







> Kevin Hanrahan wrote on 28/06/2005 08:03:49:
>
> OK, ...thanks for the reply... I tried that, I think.
>
> I made a custom script for checking domain registration expiration dates
and
> I am calling it from hobbitlaunch as such:
>
> [Domain Registration]
> CMD /home/hobbit/server/ext/ext-domainname.sh
> INTERVAL 1400m
>
> I am passing the status of the test (using an allready existing BB test)
> like this:
>
>
> #  Get Status proc - used to get all responses
> #
> get_status()
> {
>   DaysLeft=`$PROBE $1`
>   RESULT="OK: Remaining days - $DaysLeft"
>   COLOR="green"
>   if [ "$DaysLeft" != "Record not found" ]
>     then
>     if [ "$DaysLeft" -le "$DAYSLEFTWARN" ]
>     then
>       RESULT="WARNING: Remaining days - $DaysLeft"
>       COLOR="yellow"
>     fi
>     if [ "$DaysLeft" -le "$DAYSLEFTERROR" ]
>     then
>       RESULT="ERROR: Remaining days - $DaysLeft"
>       COLOR="red"
>     fi
>   else
>     RESULT="ERROR: $DaysLeft"
>     COLOR="red"
>   fi
>   echo "$COLOR+1430m `date` $RESULT"
> }


You shouldn't be adding the status lifetime to color...
  echo "$COLOR `date` $RESULT"


> #  Main body
> $GREP "$TEST" $BBHOSTS |
> while read line; do
>   TESTNAME=`echo "$line" | awk '{print $2}'`
>   STATUS=`get_status $TESTNAME`
>   if [ ! -z "$STATUS" ]
>   then
>     # NOW USE THE BB COMMAND TO SEND THE DATA ACROSS
>     SDISPLAY="status $TESTNAME.$TEST $STATUS"
>     echo "$SDISPLAY" >> /tmp/ext-domainname.output
>     $BB $BBDISP "$SDISPLAY"
>   fi
> done


...you should be adding it here to status!
  SDISPLAY="status+1430 $TESTNAME.$TEST $STATUS"


>
> After 30 minutes it always goes purple! I thought I was adding 1430
minutes
> to the result time...am I wrong?
>
> I am no coder so please be patient but I could use some direction here
> please.
>
> Thank you
>
> kevin

HTH!
Andy.

>
> -----Original Message-----
> From: henrik
> Sent: Saturday, June 25, 2005 2:16 AM
> To: hobbit at hswn.dk
> Subject: Re: [hobbit] Extend timers to avoid purples

>
> On Sat, Jun 25, 2005 at 01:59:45PM +1200, Andy France wrote:
> >
> >
> > Kevin Hanrahan wrote on 25/06/2005 07:49:42:
> >
> > > Can anybody tell me how to get a test to avoid purples if it is only
> > > run once a day?  Thanks
> > >
> >
> > As Hobbit doesn't have it's own client (yet!), I'll assume it
> > understands all of the standard bb client options.
> >
> > If you read the help pages on the bb4.org site

> Or do a "man bb".

> Except I hadn't gotten around to describing the full syntax of the status
> command. It's in there now.

> > When you call the bb client executable from your script, change
> > "status" to "status+1440" in the message header for the lifetime to be
> > 24 hours.

> Hobbit also accepts "status+25h"

>
> Regards,
> Henrik


#####################################################################################

This email is intended for the person to whom it is addressed
only. If you are not the intended recipient, do not read, copy
or use the contents in any way. The opinions expressed may not
necessarily reflect those of ZESPRI Group of Companies ('ZESPRI').

While every effort has been made to verify the information
contained herein, ZESPRI does not make any representations 
as to the accuracy of the information or to the performance
of any data, information or the products mentioned herein.
ZESPRI will not accept liability for any losses, damage or
consequence, however, resulting directly or indirectly from
the use of this e-mail/attachments.
#####################################################################################



More information about the Xymon mailing list