LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   nagios check_ntp_time offset different from ntpq -p (https://www.linuxquestions.org/questions/linux-software-2/nagios-check_ntp_time-offset-different-from-ntpq-p-878411/)

thllgo 05-02-2011 04:05 PM

nagios check_ntp_time offset different from ntpq -p
 
Hello,

One of the main things I need Nagios to do is check the servers for time drift. I have all my servers running ntp against an NTP server, but I still get some nasty drift on some of the systems. I want Nagios to monitor this drift and inform me when the drift reaches a certain point then I can go in to reset the time on the system. My question is the accuracy of the check_ntp_time function or am I reading it wrong.

Running "check_ntp_time -H time01" produces the following output
Quote:

NTP OK: Offset -0.0006129741669 secs|offset=-0.000613s;60.000000;120.000000;
Running "ntpq -p" produces the following output
Quote:

remote refid st t when poll reach delay offset jitter
==============================================================================
*time01 LOCAL(0) 11 u 963 1024 377 1.276 -0.292 0.020
You can see the offset returned by check_ntp_time is -0.0006129741669
whereas the offset from ntpq -p is -0.292

I don't see a match from the check_ntp_time function, they are not even what I would call close. Am I misunderstanding something or is there a large difference in values between the ntpq command and check_ntp_time function?

Thank you

acid_kewpie 05-02-2011 04:10 PM

Quote:

I have all my servers running ntp against an NTP server
Erm, no you don't, you're just monitoring your own time clearly, there are no remote NTP servers listed in the ntpq output.

the nagios script does a check between a real ntp server and the box, totally separate to ntp on the local machine, so there is no reason to expect the numbers to match up exactly. especially when your local machine is not syncing to anything at all.

thllgo 05-02-2011 05:00 PM

time01 is a remote server

thllgo 05-02-2011 05:03 PM

you may have gotten confused because there wasn't a line that reads something like
*LOCAL(1) LOCAL(1) 10 l 28 64 377 0.00 0.000 10.01
This is because NTP is setup not to use the local clock for comparison. It only compares to time01.

acid_kewpie 05-03-2011 12:31 AM

Yeah, my bad.. . it was late... But why is your trusted server only using local??

thllgo 05-04-2011 08:59 AM

The clock on the trusted server is fairly accurate and I'm on a closed network without access to a real NTP server. My main concern is keeping the servers in agreement with each other as to what the time is. The NTP clients don't use their own local clock as they are all VMs and I've noticed that most of them are quite inaccurate.


All times are GMT -5. The time now is 06:04 PM.