Am 20.06.2013 um 07:58 schrieb Kenyon Ralph <[email protected]>:

On 2013-06-20T01:42:28-0400, AlbyVA <[email protected]> wrote:
I've been running MRTG to create graphs of my NTP offsets, along with
other stats on bandwidth and system load.
I was wondering if anybody had a sample config script for creating RRD
graphs with NTP offset data? I've got
rrdtool compiled on my FreeBSD box, but little info on how to go about
creating .png graphs.  Any help is
appreciated.

I suspect you'll have a much easier time setting up something that
abstracts away the details of RRDtool, such as munin [0]. Munin
already has several plugins (the pieces of code that create graphs)
for NTP, both in the standard distribution [1] and the contrib
repository [2]. The munin "master" collects data from munin "nodes"
(the master can also be a node), and the master generates graphs and
HTML pages. Example: http://demo.munin-monitoring.org/

[0] http://munin-monitoring.org/
[1] https://github.com/munin-monitoring/munin/tree/devel/plugins/node.d
[2] https://github.com/munin-monitoring/contrib/tree/master/plugins/time

Here's the script I use:
#!/bin/sh
# $Schlepperbande: config/eisenboot/munin/ntp,v 1.8 2012/07/28 12:49:27 stb Exp $
#
#%# family=auto
#%# capabilities=autoconf

if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi

if [ "$1" = "config" ]; then
cat <<EOF
graph_title NTP Time Statistics
graph_vlabel ppm / ms
graph_info This graph shows clock statistics from ntpd.
graph_category time
graph_scale no
offset.label Offset (ms)
offset.info Time offset in milliseconds
offset.colour c0000080
jitter.label Jitter (ms)
jitter.info Clock jitter in milliseconds
jitter.colour 00c0c080
frequency.label Freq. (ppm)
frequency.info Frequency drift of the local clock
frequency.colour 00c00080
stability.label Stab. (ppm)
stability.info Stability of the local clock
stability.colour 0000c080
EOF
exit 0
fi

/usr/sbin/ntpdc -c loopinfo -c sysinfo | awk '
/^offset:/ { print "offset.value", $2*1000.0 }
/^jitter:/ { print "jitter.value", $2*1000.0 }
/^frequency:/ { print "frequency.value", $2 }
/^stability:/ { print "stability.value", $2 }
'

And this is the output:

-- 
Stefan Bethke <[email protected]>   Fon +49 151 14070811



_______________________________________________
pool mailing list
[email protected]
http://lists.ntp.org/listinfo/pool

Reply via email to