[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [xymon] best way to determine if the Xymon server just started?
- To: xymon (at) xymon.com
- Subject: Re: [xymon] best way to determine if the Xymon server just started?
- From: Henrik "Størner" <henrik (at) hswn.dk>
- Date: Thu, 18 Nov 2010 21:33:45 +0000 (UTC)
- Newsgroups: lists.hobbit
- Organization: Linux Users Inc.
- References: <E0299E62DC82494EA6C14D5E4FABA3F704F38E09 (at) ASHEVS006.mcilink.com>
- User-agent: nn/6.7.3
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