Operating System - HP-UX
1833059 Members
2562 Online
110049 Solutions
New Discussion

NTP, time difference between th ntp server and HP UX machine

 
SOLVED
Go to solution
Silver_1
Regular Advisor

NTP, time difference between th ntp server and HP UX machine

Hi,
How can i find out an HP UX server is in "sync" with NTP server or in other words what is the time difference betweem the NTP server and the HP UX server ?

If their is a time difference, can i do this procedure..

stop xntpd
ntpdate -b (ntp server)
start xntpd.

Thanks in advance.
4 REPLIES 4
Patrick Wallek
Honored Contributor
Solution

Re: NTP, time difference between th ntp server and HP UX machine

There should be no discernable difference, if NTP is configured correctly and running.

You can do an 'ntpq -p' to see the status of the NTP servers, the last time they were polled, etc. Do a 'man ntpq' to learn what the output means.

I would not recommend doing an 'ntpdate' while applications are running and the system is up. That should only be done at boot time before applications even start.

NTP is robust enough that once it is set up and configured, it needs very little care and feeding.
James R. Ferguson
Acclaimed Contributor

Re: NTP, time difference between th ntp server and HP UX machine

Hi:

Use 'ntpq -p' to query the associations betwee your server and its time sources. See the manpages for more information.

When you setup NTP ('xntpd') you need to set your server's time to a very nearly correct value to allow 'xntpd' to synchronize your server's time. NTP will abandon all attempts at time synchronization if its time source and its server differ by more than about 1000 seconds.

I would suggest that you configure NTP to set the server time to that of its time source(s) during bootup (by configuring the NTPDATE_SERVER variable in '/etc/rc.config.d/netdaemons') and thereafter let NTP run continuously.

Setting your local time forward isn't a problem. Setting time backwards can cause great problems with database recovery, transaction synchronization, logs and cron tasks. Should you need to step the time backwards, having configured the NTPDATE_SERVER variable means that the time the change is made during startup before the time-sensitive things (databases) are started.

Hence, if you need to move time backwards, I would arrange a point where you can simply reboot with the above configuration in place. If your local time is behind true time, you can simply step (with 'date mmddhhmm') the time to very near what is correct and thereafter let NTP synchronize your clock.

Regards!

...JRF...
Bill Hassell
Honored Contributor

Re: NTP, time difference between th ntp server and HP UX machine

The ntpq -p will query all your NTP servers. The first column of interest is REACH. When this column reaches the maximum value of 377, this NTP server is reachable and useful as a time source. The next column is the POLL. xntpd polls the NTP servers every 64 seconds until a stable time has been obtained. Using complicated computations, the POLL time is then increased to 128 seconds and tested for reliability, then 256, and so on until the maximum of 1024 seconds (once every 17 minutes). Finally, the DISP is the dispersion which indicates the variance in the NTP servers as seen from your system.

You will also see a special character in column 1, * menas the currently preferred server, + indicates servers that are also considered to be accurate and reliable. Other characters can be decoded from the ntpq man page.

So check syslog and ntpq -p every few days, then once a week or so to see that your NTP servers are working as expected.


Bill Hassell, sysadmin
Silver_1
Regular Advisor

Re: NTP, time difference between th ntp server and HP UX machine

Thanks Guys!