LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-09-2013, 12:31 PM   #1
Led Zappa
LQ Newbie
 
Registered: Jan 2008
Distribution: Centos 5
Posts: 20

Rep: Reputation: 0
Server synced to internal NTP/Nagios Server - Nagios Still Reports Timecheck Warning


I have a server that has no access to the internet. I have set the server to check the Nagios Server as NTP Server. I can see that it has synced in the messages log and updated the time by 4 seconds, but is still over 3 seconds off.

How can Nagios Server report the time as off when it's the NTP Server? I have checked the times manually of both my new server and the nagios server and they appear to be in sync.

Here are the last view messages in /var/log/messages

Code:
Sep  9 09:09:49 hostname ntpd[10348]: synchronized to 172.16.200.2, stratum 3
Sep  9 09:09:49 hostname ntpd[10348]: time reset +4.824030 s
Sep  9 09:10:06 hostname ntpdate[10357]: ntpdate 4.2.4p8@1.1612-o Fri Feb 22 11:23:28 UTC 2013 (1)
Sep  9 09:10:06 hostname ntpdate[10357]: no servers can be used, exiting
Sep  9 09:14:01 hostname ntpd[10348]: synchronized to 172.16.200.2, stratum 3
Sep  9 09:15:01 hostname ntpdate[10367]: ntpdate 4.2.4p8@1.1612-o Fri Feb 22 11:23:28 UTC 2013 (1)
Sep  9 09:15:01 hostname ntpdate[10367]: no servers can be used, exiting
Sep  9 09:20:01 hostname ntpdate[10378]: ntpdate 4.2.4p8@1.1612-o Fri Feb 22 11:23:28 UTC 2013 (1)
Sep  9 09:20:01 hostname ntpdate[10378]: no servers can be used, exiting
Sep  9 09:24:49 hostname ntpd[10348]: kernel time sync status change 2001
Sep  9 09:25:01 hostname ntpdate[10386]: ntpdate 4.2.4p8@1.1612-o Fri Feb 22 11:23:28 UTC 2013 (1)
Sep  9 09:25:01 hostname ntpdate[10386]: no servers can be used, exiting

Last edited by Led Zappa; 09-09-2013 at 12:34 PM.
 
Old 09-09-2013, 01:02 PM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,711

Rep: Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279
ntpdate can't be used while ntpd is running (they use the same port).
 
Old 09-09-2013, 01:15 PM   #3
Led Zappa
LQ Newbie
 
Registered: Jan 2008
Distribution: Centos 5
Posts: 20

Original Poster
Rep: Reputation: 0
Which one should I be using? I stopped ntpd and ran ntupdate and got this response.

> 9 Sep 10:10:01 ntpdate[10469]: no servers can be used, exiting

I just want the new servers being built to be able to check an internal NTP Server and sync on a regular schedule so I stop getting email alerts.

I have inherited this network. Nagios was set up already with groups and services etc already configured. I am trying to use the same group for the same type of servers being built. One of the things this group checks is "Timecheck" and I get all kinds of email alerts because of this. It seems easier to resolve this issue than start changing services and groups in Nagios since I am a newbie, especially to Nagios.

How can I verify that my Nagios server is acting as an NTP Server that can be used as a time sync for other servers?

That being said, I still can't understand how it synced to the Nagios server, adjusted for 4 seconds and still reports it's not in sync by over 3 seconds.

Last edited by Led Zappa; 09-09-2013 at 01:30 PM.
 
Old 09-09-2013, 02:21 PM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,711

Rep: Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279
ntpdate is for setting the system time to a remote standard. It cannot work at the same time as ntpd as it uses the same port. The functionality of ntpdate is in ntpd, but you have to have an internet connection for either of them to set the time.

ntpd CAN run using the local clock for a reference. The assumption is that other systems on the same network will use it for a time "standard".

but you can't use ntpdate to set the time for a ntpd server... there is no external reference available. For other systems on the net, the ntp "server" provides that external reference, so they CAN sync to this servers clock using ntpdate or the internal version in ntpd.

You can look at the ntpq utility for making ntp queries.

Last edited by jpollard; 09-09-2013 at 02:25 PM.
 
Old 09-09-2013, 02:49 PM   #5
Led Zappa
LQ Newbie
 
Registered: Jan 2008
Distribution: Centos 5
Posts: 20

Original Poster
Rep: Reputation: 0
So on the Nagios server with internet access I did this:

Code:
[root@netops2 plugins]# service ntpd stop
Shutting down ntpd:                                        [  OK  ]
[root@nagios plugins]# ntpdate 0.centos.pool.ntp.org
 9 Sep 11:31:05 ntpdate[15982]: adjust time server 65.49.70.244 offset 0.001087 sec
[root@nagios plugins]# service ntpd start
Starting ntpd:                                             [  OK  ]
[root@nagios plugins]#
I then ran this on the client without internet access, but access to the Nagios server:

Code:
[root@client ~]# ntpdate nagios
 9 Sep 11:29:01 ntpdate[10685]: adjust time server 172.16.200.2 offset -0.004930 sec
So I think I have it working right, but I'm still at a loss for the 3 second descrepency. I have a hosted server that was giving me a timecheck error, ran "ntpdate 0.centos.pool.ntp.org" and that server is now in almost perfect sync with the Nagios server.

screenshot of nagios alert: https://dl.dropboxusercontent.com/u/85818514/Nagios.png

Last edited by Led Zappa; 09-09-2013 at 02:55 PM.
 
Old 09-09-2013, 02:57 PM   #6
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,711

Rep: Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279Reputation: 1279
ntpd syncs the system time by spreading small increments over about 15 minutes.

I have used ntpdate to set the clock during boot, and ntpd to maintain the clock afterwards.
 
Old 09-09-2013, 05:18 PM   #7
Led Zappa
LQ Newbie
 
Registered: Jan 2008
Distribution: Centos 5
Posts: 20

Original Poster
Rep: Reputation: 0
Thanks for your help. Helped me understand ntp services and solve another issue.

My resolution to this is that I figured out how to up the threshold of the check in the nrpe.cfg file, so that I don't get a warning until a 10 second difference is detected. Since I don't care about the time sync much for these servers and I know the time is correct anyways this will work and I will stop getting email alerts.

If anybody does know why there is a 3 second difference in reporting I'd be glad to hear it.

Now to fix all the other machines with this issue. Uhg!

Last edited by Led Zappa; 09-09-2013 at 05:20 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] Nagios INternal server error ahmadirad Linux - Newbie 19 12-20-2015 11:20 AM
Nagios 3.1.2 + RHEL 5.3 You don't have permission to access /nagios/ on this server psix Linux - Server 13 08-04-2015 03:25 AM
icinga / nagios problem - Internal server error kimaaa Linux - Software 3 12-20-2013 10:34 AM
i am unable to monitor or connect remote linux server uning nagios 3.3 on nagios linn nandunay Linux - Server 2 05-09-2012 05:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:30 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration