The chronyd service uses the /etc/chrony.conf
configuration file to set synchronization parameters. The default contents of this file contains everything that is needed to set up successful synchronization. To be able to configure the chrony statistics, we need to configure the “log”T command in the /etc/chrony.conf
configuration file. The log command indicates that certain information is to be logged. The syntax of the log command is as shown below.
log [name] [...]
The available statistics are:
- measurements : This option logs the raw NTP measurements and related information to a file called measurements.log.
- tracking – This option logs changes to the estimate of the system’s gain or loss rate, and any slews made, to a file called tracking.log.
- rtc – This option logs information about the system’s real-time clock.
- refclocks – This option logs the raw and filtered reference clock measurements to a file called refclocks.log.
- tempcomp – This option logs the temperature measurements and system rate compensations to a file called tempcomp.log.
Enabling chrony statistics
1. Add log [name] in /etc/chrony.conf as shown below:
# grep -w log /etc/chrony.conf logdir /var/log/chrony # log measurements statistics tracking log measurements statistics tracking
2. TWe need to restart the chronyd for the changes to take affect.
# systemctl restart chronyd
3. The log files will be created under /var/log/chrony/.
# ll /var/log/chrony/ total 16 -rw-r--r--. 1 chrony chrony 4961 Apr 20 16:39 measurements.log -rw-r--r--. 1 chrony chrony 3885 Apr 20 16:39 statistics.log -rw-r--r--. 1 chrony chrony 3762 Apr 20 16:39 tracking.log
4. When checking the log, need to refer the definition of chrony.tuxfamily.org
# cat tracking.log ================================================================================================== Date (UTC) Time IP Address St Freq ppm Skew ppm Offset L Co Offset sd Rem. corr. ================================================================================================== 2018-04-20 08:39:19 0.0.0.0 0 3.391 6.206 0.000e+00 ? 0 0.000e+00 0.000e+00 2018-04-20 08:39:29 10.16.255.1 2 3.391 6.206 9.249e-04 N 1 1.047e-03 0.000e+00 2018-04-20 08:39:32 10.16.255.1 2 3.391 6.206 7.694e-05 N 1 7.168e-04 -3.900e-04 ...
The columns are as follows (the quantities in square brackets are the values from the example line above):
- Date – Note that the date/time pair is expressed in UTC, not the local time zone.
- IP Address – The IP address of the server/peer to which the local system is synchronised.
- St – The stratum of the local system.
- Freq – The local system frequency (in ppm, positive means the local system runs fast of UTC).