System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

How to check the system clock HPUX 11i

How to check the system clock HPUX 11i

Hi All,

I'm looking for a way to check the system clock settings via the command line.

My system is connected to an NTP server and my understanding is (please correct me if I'm wrong) that if connection with the NTP server is lost the system will start taking its time from the local system clock (in a PC world I'm talking about the one powered by the small battery in the motherboard) ... What I'm trying to check is the time the system will present if the connection with the NTP server is lost.

This is a production system and I can't disconnect it from the NTP side but in a problem we had recently I want to discard a significant hour difference between the local clock and NTP.

Thanks in advance,

Daniel
5 REPLIES
Marco A.
Esteemed Contributor

Re: How to check the system clock HPUX 11i

Hi Daniel,

Normally after the unsync ..the differences are not too much, basically you are setting the same system time but taking it from another source, I mean, if you are running NTP you will be seeing that, if you lose the connection to the time sources, then you can use the system time without issues.
A good practice is use additional sources to the ones that you have, to be connected all the time even if one of the sources fail.

Something like this at the ntp.conf

server 0.us.pool.ntp.org
server 1.us.pool.ntp.org
server 2.us.pool.ntp.org

Additionally to that, if your date/time / timezone are set correctly right now in the system, if you lose the connection you don't have to face critical issues, the system will continue with the normal time.

Regards,

Marco,
Just unplug and plug in again ....
Marco A.
Esteemed Contributor

Re: How to check the system clock HPUX 11i

oh..., forgot.

Too check it online, you need to log to the GSP console , well it depends if you are running IA or PA , but well ..., almost the same, log into the console for it.

Regards,

Marco,
Just unplug and plug in again ....
Matti_Kurkela
Honored Contributor

Re: How to check the system clock HPUX 11i

In HP-UX, when system time is changed in any way, the changed time is automatically copied to the local system clock. This is enforced by the HP-UX kernel.

So if your system is currently synced with a NTP server, there is no possibility that the local system clock would have a grossly wrong time.

If the connection to the NTP servers is lost, the local system clock is automatically used... but it is unlikely to be as accurate as a good NTP timesource, so the system time will probably start slowly "drifting" away from the true time.

If you're concerned about the drift rate, you should allow the NTP daemon to maintain a drift file for you. It is enabled in /etc/ntp.conf file by a line like this:

driftfile /etc/ntp.drift

The NTP daemon will calculate the average drift rate of the local system clock by tracking how much it needs to correct the system time. This value is stored to this file, if the file exists and is writeable by the daemon.

You could use this value to find out how accurate the system clock would be without the NTP synchronization. Large (negative or positive) values would be bad, zero would be perfect. The value is in parts-per-million (PPM). A value of 1000 would mean the local system clock has an error of 0.001 seconds for every true second.

You should enable the drift file, and then monitor the long-term development of the drift rate value (over days/weeks). If the value does not stabilize to or near any fixed value, or becomes abnormally large, you might want to investigate further at the next scheduled maintenance break. On a critical system, you might even open a case with HP for evaluation and possible HW repair.

MK
MK
Bill Hassell
Honored Contributor

Re: How to check the system clock HPUX 11i

The system clock always runs and presents the current time to the kernel. If you run NTP, the clock will be slowly adjusted to match UTC time (which is the system clock's time). If you lose all the NTP servers, the clock still runs just fine. NTP will start adjusting the clock when it returns.

Note that being off by an hour is highly suspicious -- not a clock problem at all but the wrong timezone has been set for the environment. Always check the clock with date -u so you know that the clock is OK. Then make sure each login has the correct TZ value to show the right timezone.


Bill Hassell, sysadmin
avizen9
Esteemed Contributor

Re: How to check the system clock HPUX 11i