Operating System - HP-UX
1825719 Members
2934 Online
109686 Solutions
New Discussion

NTP Issue with 10.20 System

 
Andrew Kaplan
Super Advisor

NTP Issue with 10.20 System

I am trying to reconfigure ntp on a 10.20 system to synchronize with two time servers as opposed to the current ones. The current time sources are the LOCAL system and another 10.20 system that is being retired.

I have gone into SAM and have added the two servers, made sure the protocol version is 3, and even marked both as preferred servers. I am not completely positive, but I believe both new time servers are Windows 200x systems. Once that was done, I restarted NTP.

The problem that I am seeing is that even though the changes are apparent in SAM as well as the /etc/ntp.conf file, whenever I run ntpq -p I still have the original servers in the output as opposed to the new ones. I verified that DNS is working by running nslookup on both new servers as well as various other domainnames.

Does anyone have any ideas as to why this is happening, and how I can correct it? Thanks.
A Journey In The Quest Of Knowledge
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: NTP Issue with 10.20 System

Hi Andrew:

I do these things via command line, not SAM.

That said, if your '/etc/ntp.conf' file has the correct time sources, stop and start the 'xntpd' daemon and then monitor with 'ntpq -pn'. Of course, it will take a few minutes to synchronize.

# /sbin/init.d/xntpd stop
# /sbin/init.d/xntpd start

Regards!

...JRF...
Peter Godron
Honored Contributor

Re: NTP Issue with 10.20 System

Andrew,
have you restarted the service ?

For further help please see:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1052584

# /sbin/init.d/xntpd stop
# /sbin/init.d/xntpd start

Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward any useful answers given to your questions.
Andrew Kaplan
Super Advisor

Re: NTP Issue with 10.20 System

Hi there --

I ran the xntpd commands and unfortunately there was no change in the output. Is there something else I could try?
A Journey In The Quest Of Knowledge
Bill Hassell
Honored Contributor

Re: NTP Issue with 10.20 System

xntpd is not the tool to test NTP services. You can look in syslog and you'll likely see a lot of xntpd errors, but not a lot to go on. So find the xntpd process and kill it (ps -e | grep xntpd).

Now change your /etc/ntp.con file to something very simple (remove all the comments -- the original copy is still in /usr/newconfig/etc/ntp.conf)

server 0.us.pool.ntp.org # US pool 0
server 1.us.pool.ntp.org # US pool 1
server 2.us.pool.ntp.org # US pool 2
fudge 127.127.1.1 stratum 10 # localhost fallback
driftfile /etc/ntp.drift # monitor drift

Do not use version or prefer...NTP does a good job in figuring all this out. The above is recommended for U.S. based systems that can reach NTP servers on the open Internet. Use this page to find other NTP pool servers:

http://www.pool.ntp.org/

If your server is blocked on port 123 for the Internet, replace the server list with your internal servers. Then test that you can actually reach a specific server *AND* that server will honor your request:

ntpdate -q 0.us.pool.ntp.org

If you see the error:
"no server suitable for synchronization found"
then the selected server is unreachable (blocked) or the server isn't running NTP or won't allow your machine to request a sync. A normal reply looks like this:

ntpdate -q 0.us.pool.ntp.org
server 192.52.107.241, stratum 5, offset 0.020184, delay 0.15833
8 Feb 11:34:48 ntpdate[1548]: adjust time server 192.52.107.241 offset 0.020184 sec

NOTE: ntpdate -q (and ntpdate -d) will NOT change the time -- they are used to debug a connection. Once you get ntpdate -q working, then test all the server you will use. NTP is particularly adept at selecting the best sources but it's a good idea to test all that are in your list (always use more than 1 if you use the Internet, 3 to 5 are recommended).

Once you get a valid response from all servers selected, look at the current time on your system. NTP will not adjust the time if it is off by more than about 10 minutes. Since changing the time on most servers with databases or other time-dependent processes can create a lot of problems, don't force a time change until:

- You have edited /etc/rc.config.d/netdaemons to change the name of the bootup time server.

then:

- shutdown all time critical processes, then run ntpdate -b a.working.ntp.server to change the time. Then start xntpd manually. Or you can run:

/sbin/init.d/xntpd start

which does the same thing.

or

- reboot

During reboot, ntpdate -b is automatically run to adjust the time just after networking is up but before time-critical processes are run. Then to monitor NTP stats, use: ntpq -p
You may want to divert the 'noisy' syslog messages from ntp into a different log. To do this:

edit: /etc/rc.config.d/netdaemons and change the line:

export XNTPD_ARGS=""
to
export XNTPD_ARGS="-l /var/adm/ntp.log"

Then kill xntpd and restart it with:

xntpd -l /var/adm/ntp.log

Also update your log-watcher to include the new logfile so it doesn't grow out of control after a few months. Be sure to check the log once in a while for errors (syslog.log or ntp.log)


Bill Hassell, sysadmin
rick jones
Honored Contributor

Re: NTP Issue with 10.20 System

The stone knives and bearskin version might be to ps -ef | grep ntp to find the pid of the xntpd and then shoot it in the head with kill -i and then start it again by hand with a direct invokation of xntpd rather than going through the service start/stop stuff.

ISTR that not all Windows servers serve time a la NTP...
there is no rest for the wicked yet the virtuous have no pillows