ntpd
Understanding that you must use ntpd, the only options AFAIK are:
disable ntp
As seen on the ntp.conf
manual page there is the possibility of disabling the ntp feedback loop, or, in layman terms: remove the ability of calculating time corrections between time servers and the local clock. The ntp.conf
line needed to activate such option is:
disable ntp
Note: when using this option the time that ntpd may give to other systems asking for a time reference could be wrong/off. Seems reasonable to use a line of deny
to deny all queries for time from other systems unless you want to monitor time drift from an external system (use deny and allow the IP of the external system).
Note: It is not completely clear to me that the system clock is actually left to "run free" by ntpd. However, it is a documented option, so if ntpd fails to comply with what is documented it is a bug.
minsane
minsane minsane
This is the minimum number of candidates available to the clock selection algorithm in order to produce one or more truechimers for the clustering algorithm. If fewer than this number are available, the clock is undisciplined and allowed to run free.
This is done by setting a line ( in ntp.conf
) like:
tos minsane 100
Or some other high number (bigger than the servers available or used).
Note: it is not clear to me that the kernel drift value is reset to 0 to avoid that the clock slowly shifts in value. May be reasonable to additionally set the disable kernel
to disable kernel discipline functions.
Related
ntpd -qn
When a ntpd
server is running ntpq -pn
could report how well the ntpd server is doing its job of keeping the system clock in sync. That is an alternative way to log the time difference.
ntpdate -q
The package ntpdate
(which is tagged as deprecated) may be used to check the time difference with:
ntpdate -q 'pool.ntp.org' # marked as deprecated.
Use ntpdate -qu 'pool.ntp.org'
so the command doesn't need root privileges to run (-u
means "use unprivileged network ports", still, the executable has to be accessible to the user).
sntp
There is a simple program to query (not change if no -s or -S option is used):
sntp pool.ntp.org
rdate
The program rdate
is able to show remote time (and local time):
rdate -np pool.ntp.org; date
Where -n
means: Use SNTP (RFC 2030) instead of the (default) RFC 868 time protocol; and, to only print the result without making any actual changes.
However, this program is limited to a resolution of whole seconds (not fractions). And, it has no options in solaris
chrony
The replacement package of ntp (chrony) is able to execute a test of time difference without setting the system clock:
chronyd -Q 'pool pool.ntp.org iburst'
I believe that those are all methods to detect (without changing) the time difference between internet ntp time and system time.
ntpd
managing time synchronisation, and then using that system as my reference against which I measure local clocks (ntpdate -qu pool.ntp.org
will test without set, for example). Let me know if this is a "sufficient" response for you, and I'll create it as a proper answer.ntpdate -q $time_server
an option? (cannot test at the moment)ntpd
due to how easy it is to monitor it.