LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-02-2011, 04:05 PM   #1
thllgo
Member
 
Registered: Sep 2003
Location: Laurel MD
Posts: 296

Rep: Reputation: 32
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
 
Old 05-02-2011, 04:10 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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.
 
Old 05-02-2011, 05:00 PM   #3
thllgo
Member
 
Registered: Sep 2003
Location: Laurel MD
Posts: 296

Original Poster
Rep: Reputation: 32
time01 is a remote server
 
Old 05-02-2011, 05:03 PM   #4
thllgo
Member
 
Registered: Sep 2003
Location: Laurel MD
Posts: 296

Original Poster
Rep: Reputation: 32
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.
 
Old 05-03-2011, 12:31 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Yeah, my bad.. . it was late... But why is your trusted server only using local??
 
Old 05-04-2011, 08:59 AM   #6
thllgo
Member
 
Registered: Sep 2003
Location: Laurel MD
Posts: 296

Original Poster
Rep: Reputation: 32
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Nagios and Oreon (Nagios web front end) installation and Configuration LXer Syndicated Linux News 1 05-31-2016 07:26 AM
LXer: April Nagios Training Dates Include Advanced Nagios Class LXer Syndicated Linux News 0 03-18-2011 09:30 AM
ntpq bsk66 Linux - Newbie 4 04-02-2009 09:10 AM
LXer: Nagios 2.5 and Oreon 1.3 (Nagios web front end) installation with screenshots LXer Syndicated Linux News 0 08-11-2006 05:33 PM
Not sure about ntpq -pn output.... r_jensen11 Linux - General 5 07-01-2004 10:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration