Ubuntu – program for analyzing NTP server statistics

12.04ntp

I'm running Ubuntu 12.04 and have the NTP server running, apparently OK. I run the Meinberg NTP server on my two Windows 7 boxes and use its associated server monitor to keep track of what it's up to.

Is there a similar Linux monitor, preferably one with a GUI that can show me how my clock is behaving, etc?

Best Answer

Not a precise answer to your question, but I see you mention you now use a gnuplot script that analyses /var/log/ntp/loopstats. I do the same, and below is the one I use myself.

If anyone is doing something better, I'd be curious too.

#! /usr/bin/gnuplot
# Remember to check you have these lines in /etc/ntp.conf and that ntpd is actually running:
#    statsdir /var/log/ntpstats/
#    statistics loopstats peerstats clockstats
#    filegen loopstats file loopstats type day enable
#    filegen peerstats file peerstats type day enable
#    filegen clockstats file clockstats type day enable

# Resolution: fullscreen
set term x11 size `xrandr | awk '/\*/{sub(/x/,",");print $1; exit}'`
set grid
set bars 0.4
set y2tics
set y2range [0:]
set ytics nomirror
set xdata time
set timefmt "%s"
set format x "%T"
set title "NTP statistics"
set ylabel "Clock offset / Roundtrip delay (ms)"
set y2label "Frequency offset (seconds per day)"
set xlabel "Time of day"
local_time = `date +%s --utc -d "12:00:00 $(date +%z)"`
utc_time   = `date +%s --utc -d "12:00:00"`
localdifferencefromUTC = utc_time - local_time
timeoffsettoday = `date +%s --utc -d "today 0:00"` + localdifferencefromUTC
plot \
  "/var/log/ntpstats/loopstats" u ($2+timeoffsettoday):($3*1000):($5*1000/2) t "Clock offset" w errorlines lt 1 lw 2 pt 187, \
  "/var/log/ntpstats/peerstats" u ($2+timeoffsettoday):($6*1000):($8*1000/2) t "Roundtrip delay" w errorbars lt 26 pt 26,\
  "/var/log/ntpstats/loopstats" u ($2+timeoffsettoday):($4*0.0864):($6*0.0864/2) axes x1y2 t "Frequency offset" w errorline lt 7 pt 65,\
  0 w l lt -1
pause mouse close