[ntp:questions] Problem monitoring NTP synchronization status

Ryan Malayter malayter at gmail.com
Tue Apr 22 21:57:17 UTC 2008

On Tue, Apr 22, 2008 at 3:50 PM,  <eespejel at 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?

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.


More information about the questions mailing list