Xymon Mailing List Archive search

Status lifetime - where?

5 messages in this thread

list John Horne · Wed, 09 May 2012 14:53:44 +0100 ·
Hello,

Using Xymon 4.3.7, if I use the 'xymon' command and specify a status
lifetime, as mentioned in the man page, is there anywhere on the server
that I can see what the lifetime is? That is, the date/time when the
status should expire. I'm assuming it must be held somewhere in order
for Xymon to know when to expire it :-)


Thanks,

John.

-- 
John Horne                   Tel: +XX (X)XXXX XXXXXX
Plymouth University, UK      Fax: +XX (X)XXXX XXXXXX
list Ralph Mitchell · Wed, 9 May 2012 10:36:15 -0400 ·
I don't recall seeing that on a xymon web page, but it's available from the
command line:

     xymon localhost "xymondboard fields=hostname,testname,validtime"

validtime is the unix timestamp in seconds when the status is no longer
valid.  Past that time, it turns purple.  Subtract that from "date +%s" and
divide by 60 to get minutes.

Ralph Mitchell
quoted from John Horne


On Wed, May 9, 2012 at 9:53 AM, John Horne <user-e95f1ec2f147@xymon.invalid>wrote:
Hello,

Using Xymon 4.3.7, if I use the 'xymon' command and specify a status
lifetime, as mentioned in the man page, is there anywhere on the server
that I can see what the lifetime is? That is, the date/time when the
status should expire. I'm assuming it must be held somewhere in order
for Xymon to know when to expire it :-)


Thanks,

John.

--
John Horne                   Tel: +XX (X)XXXX XXXXXX
Plymouth University, UK      Fax: +XX (X)XXXX XXXXXX

list John Horne · Wed, 09 May 2012 16:52:27 +0100 ·
quoted from Ralph Mitchell
On Wed, 2012-05-09 at 10:36 -0400, Ralph Mitchell wrote:
I don't recall seeing that on a xymon web page, but it's available
from the command line:


     xymon localhost "xymondboard fields=hostname,testname,validtime"


validtime is the unix timestamp in seconds when the status is no
longer valid.  Past that time, it turns purple.  Subtract that from
"date +%s" and divide by 60 to get minutes.
Thanks for this. However, what I think I need is to see where the
'validtime' is actually stored.

I'm getting a little odd situation where if I send a status with a
lifetime, then send a second status with a shorter lifetime, when that
second one expires I then get a purple report. I *think* that is what is
happening, I'm still testing it but getting a bit confused. I'll
probably need to start from scratch (with a green status) tomorrow.

The above xymon command shows that when the second lifetime expires the
(reported) lifetime suddenly becomes the current time rather than the
first lifetime or even the current time plus 30 mins. Hence, I would
like to see what is actually being stored.
quoted from Ralph Mitchell


John.

-- 
John Horne                   Tel: +XX (X)XXXX XXXXXX
Plymouth University, UK      Fax: +XX (X)XXXX XXXXXX
list Japheth Cleaver · Wed, 9 May 2012 09:09:58 -0700 (PDT) ·
quoted from Ralph Mitchell
On Wed, 2012-05-09 at 10:36 -0400, Ralph Mitchell wrote:
I don't recall seeing that on a xymon web page, but it's available
from the command line:


     xymon localhost "xymondboard fields=hostname,testname,validtime"


validtime is the unix timestamp in seconds when the status is no
longer valid.  Past that time, it turns purple.  Subtract that from
"date +%s" and divide by 60 to get minutes.
Thanks for this. However, what I think I need is to see where the
'validtime' is actually stored.
IIRC, this is in a structure that exists entirely in memory. It's
checkpointed every 15m (by default) in xymond.chk in your tmpdir, so you
could retrieve it from there if you need to. You can also send xymond a
USR1 signal to force an immediate checkpoint.
quoted from John Horne

I'm getting a little odd situation where if I send a status with a
lifetime, then send a second status with a shorter lifetime, when that
second one expires I then get a purple report. I *think* that is what is
happening, I'm still testing it but getting a bit confused. I'll
probably need to start from scratch (with a green status) tomorrow.

The above xymon command shows that when the second lifetime expires the
(reported) lifetime suddenly becomes the current time rather than the
first lifetime or even the current time plus 30 mins. Hence, I would
like to see what is actually being stored.
I believe xymond will always use the most-recent TTL for a status report
as canon. To wit: "The last report I got said to expect something else
within XX minutes."

Regards,

-jc
list John Horne · Thu, 10 May 2012 16:34:05 +0100 ·
quoted from John Horne
On Wed, 2012-05-09 at 14:53 +0100, John Horne wrote:
Hello,

Using Xymon 4.3.7, if I use the 'xymon' command and specify a status
lifetime, as mentioned in the man page, is there anywhere on the server
that I can see what the lifetime is? That is, the date/time when the
status should expire. I'm assuming it must be held somewhere in order
for Xymon to know when to expire it :-)
Thanks for all the replies.

Yes, it does seem that the lifetime data is held in memory, but xymond
does maintain a checkpoint file (the man page has a couple of options
about this).
Yes, sending a USR1 signal to xymond forces an update of the checkpoint
file.
So by simply grepping for 'host.service' in the checkpoint file shows me
the actual 'status' command received.

It turns out that in some instances my program was sending a status with
a negative lifetime! In that respect Xymon was doing the right thing in
that the status had already expired, so it showed purple as if no status
had been received.
quoted from John Horne


John.

-- 
John Horne                   Tel: +XX (X)XXXX XXXXXX
Plymouth University, UK      Fax: +XX (X)XXXX XXXXXX