Understanding that you must use ntpd, the only options AFAIK are:
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:
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.
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
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.
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 (which is tagged as deprecated) may be used to check the time difference with:
ntpdate -q 'pool.ntp.org' # marked as deprecated.
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).
There is a simple program to query (not change if no -s or -S option is used):
rdate is able to show remote time (and local time):
rdate -np pool.ntp.org; date
-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
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.