Problem monitoring NTP synchronization status - NTP
This is a discussion on Problem monitoring NTP synchronization status - NTP ; Hi there. I did just set up a Linux box to time synchronize to a Cisco
router. I would like to have a way to know whenever the Linux box
stops synchronizing (because of any network connecticity issue, for
instance). ...
-
Problem monitoring NTP synchronization status
Hi there. I did just set up a Linux box to time synchronize to a Cisco
router. I would like to have a way to know whenever the Linux box
stops synchronizing (because of any network connecticity issue, for
instance). any ideas?
-
Re: Problem monitoring NTP synchronization status
eespejel@gmail.com wrote:
> Hi there. I did just set up a Linux box to time synchronize to a Cisco
> router. I would like to have a way to know whenever the Linux box
> stops synchronizing (because of any network connecticity issue, for
> instance). any ideas?
Poll it with an NTP client and check the stratum. Use ntpq to check the
stratum. If it is using the kernel time discipline, monitor the kernel
estimate of error (and possibly the state of the kernel discipline).
Note that a lost server doesn't mean the time is wrong, as it will coast
along with the last known frequency correction.
-
Re: Problem monitoring NTP synchronization status
On Tue, Apr 22, 2008 at 3:50 PM, wrote:
> Hi there. I did just set up a Linux box to time synchronize to a Cisco
> router. I would like to have a way to know whenever the Linux box
> stops synchronizing (because of any network connecticity issue, for
> instance). any ideas?
Run a script on the Linux box that periodically calls "ntpq -q
localhost", then parses the output. The script should check that the
line for Cisco your router begins with an asterisk in the ntpq -q output.
This means your router has been selected as the synchronization source
by the clock filter. If it doesn't have an asterisk, have the script
do whatever alert action you want - email, syslog, etc.
If you have more than one server configured in your ntpd, you will
have to add some smarts to handle or ignore those as appropriate.
I do not have an example script, unfortunately.
--
RPM
-
Re: Problem monitoring NTP synchronization status
eespejel@gmail.com writes:
>Hi there. I did just set up a Linux box to time synchronize to a Cisco
>router. I would like to have a way to know whenever the Linux box
>stops synchronizing (because of any network connecticity issue, for
>instance). any ideas?
$!/bin/sh
if ! ntpq|grep '* name.of.router'>/dev/null; then
mail -s "NTP sync has been lost" your.name@youremil.com
fi
And put the shell script into crontab to run every minute.
(your milage may vary)
-
Re: Problem monitoring NTP synchronization status
>$!/bin/sh
>if ! ntpq|grep '* name.of.router'>/dev/null; then
> mail -s "NTP sync has been lost" your.name@youremil.com
>fi
>
>And put the shell script into crontab to run every minute.
>(your milage may vary)
That could lead to a lot of clutter in your mailbox.
--
These are my opinions, not necessarily my employer's. I hate spam.
-
Re: Problem monitoring NTP synchronization status
hal-usenet@ip-64-139-1-69.sjc.megapath.net (Hal Murray) writes:
>>$!/bin/sh
>>if ! ntpq|grep '* name.of.router'>/dev/null; then
>> mail -s "NTP sync has been lost" your.name@youremil.com
>>fi
>>
>>And put the shell script into crontab to run every minute.
>>(your milage may vary)
>That could lead to a lot of clutter in your mailbox.
Yup, it sure could. But you would know when something went wrong.
(Of course you could become more sophisticated and not send the mail if the
last time the shell ran, mail was sent, etc. ) All I am pointing out to the
Op is that running a cron shell can be used to notify. How often he wants
to be notified, etc, it up to him.
-
Re: Problem monitoring NTP synchronization status
>>> In article , eespejel@gmail.com writes:
eespejel> Hi there. I did just set up a Linux box to time synchronize to a
eespejel> Cisco router. I would like to have a way to know whenever the
eespejel> Linux box stops synchronizing (because of any network connecticity
eespejel> issue, for instance). any ideas?
http://support.ntp.org/bin/view/Supp...ControllingNTP
--
Harlan Stenn
http://ntpforum.isc.org - be a member!