[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
howtos:network_services:ntp [2013/03/01 16:36 (UTC)] – Added a short explanation about problems with NFS and NIS when clients are out of sync kikinovakhowtos:network_services:ntp [2014/02/17 06:30 (UTC)] kikinovak
Line 172: Line 172:
   .   .
   ntpd -qg &   ntpd -qg &
 +  
 +===== Monitor the performance of ntpd =====
 +
 +You will notice that the logfile ''/var/log/ntp.log'' does not contain any information about the actual accuracy of your system clock. If it's important to you, you can log the statistics of time corrections applied by NTP daemon to the system clock. To do this, add the following lines to ''/etc/ntp.conf'':
 +
 +<code>
 +statsdir /var/log/ntp/
 +statistics loopstats
 +filegen loopstats file loops type day link enable
 +</code>
 +
 +You have to create the statsdir manually. Once the configuration changes are in effect, ''ntpd'' will create files named ''loops.YYYYMMDD'' in that directory. Below is an example line from one of these files:
 +<code>
 +56690 3950.569 0.001199636 2.297 0.001830770 0.571576 10
 +</code>
 +
 +The first and second number are the UTC time (expressed as [[http://en.wikipedia.org/wiki/Julian_day|Modified Julian Date]] and seconds elapsed since midnight). The third and fourth number are the offsets of time (in seconds) and of frequency (in parts per million). The fifth and sixth number are their respective uncertainties.
 +
 +To monitor the performance of ''ntpd'', you can examine the plot of clock offset or frequency offset vs. time:
 +
 +<code>
 +$ awk '{printf("%f %f %f\n", $1+$2/86400, $3, $5)}' /var/log/ntp/loops.* > time
 +$ awk '{printf("%f %f %f\n", $1+$2/86400, $4, $6)}' /var/log/ntp/loops.* > freq
 +$ gnuplot
 +gnuplot> set xzeroaxis
 +gnuplot> plot 'time' with yerror
 +gnuplot> plot 'freq' with yerror
 +</code>
 +
 +Given enough data, visual examination of the plots will allow you to see peculiarities in ''ntpd'' performance, should they arise. For example, in the case illustrated by [[http://www.astro.uni.wroc.pl/ludzie/drobek/ntp_time+freq.png|this figure]], the rapid decrease of the frequency offset was caused by replacing the power supply unit of the machine.
  
 ====== Sources ====== ====== Sources ======
  
   * Originally written by [[wiki:user:kikinovak|Niki Kovacs]]   * Originally written by [[wiki:user:kikinovak|Niki Kovacs]]
 +  * Performance monitoring section contributed by Dominik Drobek
  
 <!-- Please do not modify anything below, except adding new tags.--> <!-- Please do not modify anything below, except adding new tags.-->
 <!-- You must remove the tag-word "template" below before saving your new page --> <!-- You must remove the tag-word "template" below before saving your new page -->
 {{tag>howtos time clock synchronization author_kikinovak}} {{tag>howtos time clock synchronization author_kikinovak}}
 howtos:network_services:ntp ()