Xymon Mailing List Archive search

best way to determine if the Xymon server just started?

5 messages in this thread

list David W Gore · Thu, 18 Nov 2010 17:25:04 +0000 ·
I have several server side scripts that give me results I would rather
not have soon after a Xymon server restart.  What is the best way to
determine if Xymon just started?  I could poke around a bit, just
wondered if someone already had some ideas already implemented.  I will
do something like exit 1 If xymon just started, otherwise continue.  

 
~David
list Josh Luthman · Thu, 18 Nov 2010 12:35:43 -0500 ·
Just look at the hobbitd column.  Goes yellow for 5 minutes when it
restarts and says...

Latest errormessages:
Loading hostnames
Loading saved state
Setting up network listener on 0.0.0.0:1984
Setting up signal handlers
Setting up hobbitd channels
Setting up logfiles
Setup complete

Josh Luthman
Office: XXX-XXX-XXXX
Direct: XXX-XXX-XXXX
XXXX Wayne St
Suite XXXX
Troy, OH XXXXX


On Thu, Nov 18, 2010 at 12:25 PM, Gore, David W
quoted from David W Gore
<user-3e5761c68b56@xymon.invalid> wrote:
I have several server side scripts that give me results I would rather not
have soon after a Xymon server restart.  What is the best way to determine
if Xymon just started?  I could poke around a bit, just wondered if someone
already had some ideas already implemented.  I will do something like exit 1
If xymon just started, otherwise continue.


~David

list David W Gore · Thu, 18 Nov 2010 17:48:46 +0000 ·
Ok, I could just do this in the script:

xymon 0 "xymondboard host=xymon1 test=xymond color=green"

As long as that returns green then execute the script.  Thanks for the hint Josh.

~David
-----Original Message-----
From: Josh Luthman [mailto:user-4c45a83f15cb@xymon.invalid]
Sent: Thursday, November 18, 2010 17:36
To: xymon at xymon.com
Subject: Re: [xymon] best way to determine if the Xymon server just
started?
quoted from Josh Luthman

Just look at the hobbitd column.  Goes yellow for 5 minutes when it
restarts and says...

Latest errormessages:
Loading hostnames
Loading saved state
Setting up network listener on 0.0.0.0:1984
Setting up signal handlers
Setting up hobbitd channels
Setting up logfiles
Setup complete

Josh Luthman
Office: XXX-XXX-XXXX
Direct: XXX-XXX-XXXX
XXXX Wayne St
Suite XXXX
Troy, OH XXXXX


On Thu, Nov 18, 2010 at 12:25 PM, Gore, David W
<user-3e5761c68b56@xymon.invalid> wrote:
I have several server side scripts that give me results I would rather
not
have soon after a Xymon server restart.  What is the best way to
determine
if Xymon just started?  I could poke around a bit, just wondered if
someone
already had some ideas already implemented.  I will do something like
exit 1
If xymon just started, otherwise continue.


~David

list Tim McCloskey · Thu, 18 Nov 2010 09:59:20 -0800 ·
You can tail the hobbitlaunch.log to get that data too.

Tim
quoted from David W Gore

From: Gore, David W [user-3e5761c68b56@xymon.invalid]
Sent: Thursday, November 18, 2010 9:25 AM
To: xymon at xymon.com
Subject: [xymon] best way to determine if the Xymon server just started?

I have several server side scripts that give me results I would rather not have soon after a Xymon server restart.  What is the best way to determine if Xymon just started?  I could poke around a bit, just wondered if someone already had some ideas already implemented.  I will do something like exit 1 If xymon just started, otherwise continue.

~David
list Henrik Størner · Thu, 18 Nov 2010 21:33:45 +0000 (UTC) ·
quoted from Tim McCloskey
In <user-32fba4a0be9e@xymon.invalid> "Gore, David W" <user-3e5761c68b56@xymon.invalid> writes:
I have several server side scripts that give me results I would rather
not have soon after a Xymon server restart.  What is the best way to
determine if Xymon just started?  I could poke around a bit, just
wondered if someone already had some ideas already implemented.  I will
do something like exit 1 If xymon just started, otherwise continue.
Check the timestamp of the PID file.

#!/bin/sh

touch --date="1 hour ago" /tmp/1hourago
if test $XYMONSERVERLOGS/xymond.pid -nt /tmp/1hourago
then
   echo "Xymon restarted less than 1 hour ago"
   exit 0
fi


Probably requires the GNU version of "touch" .


Regards,
Henrik