Xymon Mailing List Archive search

Script Delay

5 messages in this thread

list Al Jeffcoat · Tue, 8 Nov 2005 20:23:28 -0500 ·
All,

Is there a way to write a script in such a way that it only reports in
once a day (I know how to do this part), and then tell hobbit not to
turn that test purple for 24 hours after it receives that last status?

TIA

Al
list Andy France · Wed, 9 Nov 2005 15:02:34 +1300 ·

"Jeffcoat, Al" wrote on 09/11/2005 02:23:28 p.m.:
quoted from Al Jeffcoat
All,
Is there a way to write a script in such a way that it only reports in
once a day (I know how to do this part), and then tell hobbit not to
turn that test purple for 24 hours after it receives that last status?
Check the man page for bb.

First option listed under "Hobbit Message Syntax" is status... check out
+LIFETIME !
TIA
Al
You're welcome,
Andy.


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

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.
#####################################################################################
list Charles Jones · Tue, 08 Nov 2005 19:07:57 -0700 ·
quoted from Andy France
Jeffcoat, Al wrote:
All,

Is there a way to write a script in such a way that it only reports in
once a day (I know how to do this part), and then tell hobbit not to
turn that test purple for 24 hours after it receives that last status?
 
Al,

Sure, just append the number of seconds to your status message (in the format of "+seconds" see example below). Hobbit will then not turn purple unless that time expires and no further status messages have been received.

$BB $BBDISP "status+86400 $MACHINE.$COLUMN $COLOR `date` &green This is a green message that won't expire for 24 hours."

-Charles
list Henrik Størner · Wed, 9 Nov 2005 07:34:20 +0100 ·
quoted from Charles Jones
On Tue, Nov 08, 2005 at 07:07:57PM -0700, Charles Jones wrote:
Jeffcoat, Al wrote:
All,

Is there a way to write a script in such a way that it only reports in
once a day (I know how to do this part), and then tell hobbit not to
turn that test purple for 24 hours after it receives that last status?
Al,

Sure, just append the number of seconds to your status message (in the format of "+seconds" see example below). Hobbit will then not turn purple unless that time expires and no further status messages have been received.

$BB $BBDISP "status+86400 $MACHINE.$COLUMN $COLOR `date` &green This is a green message that won't expire for 24 hours."
And it's usually a good idea to add a bit of extra time to give the
script time to run the next time - say, half an hour extra.


Regards,
Henrik
list Al Jeffcoat · Tue, 15 Nov 2005 13:32:15 -0500 ·
Thanks very much for the reply (and Andy and Henrik also)...

However, the default time is in minutes, not seconds.  I was trying to
figure out why status+87600 wasn't turning purple after 24.5 hours :)

From the man page (thanks again Andy).  "The LIFETIME is in minutes,
unless you add an "h" (hours), "d" (days) or "w" (weeks) immediately
after the number, e.g. "status+5h" for a status that is valid for 5
hours."

Thanks,

Al 
quoted from Charles Jones
 

-----Original Message-----
From: Charles Jones [mailto:user-e86b4aeade4e@xymon.invalid] 
Sent: Tuesday, November 08, 2005 9:08 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] Script Delay

Jeffcoat, Al wrote:
All,

Is there a way to write a script in such a way that it only reports in
once a day (I know how to do this part), and then tell hobbit not to
turn that test purple for 24 hours after it receives that last status?
 
Al,

Sure, just append the number of seconds to your status message (in the 
format of "+seconds" see example below). Hobbit will then not turn 
purple unless that time expires and no further status messages have been

received.

$BB $BBDISP "status+86400 $MACHINE.$COLUMN $COLOR `date` &green This is
a green message that won't expire for 24 hours."

-Charles