Xymon Mailing List Archive search

best way to determine if the Xymon server just started?

list Henrik Størner
Thu, 18 Nov 2010 21:33:45 +0000 (UTC)
Message-Id: <ic463p$76c$user-e356fad9864f@xymon.invalid>

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