[xymon] best way to determine if the Xymon server just started?

Henrik Størner henrik at hswn.dk
Thu Nov 18 22:33:45 CET 2010


In <E0299E62DC82494EA6C14D5E4FABA3F704F38E09 at ASHEVS006.mcilink.com> "Gore, David W" <david.gore at verizonbusiness.com> 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




More information about the Xymon mailing list