2012-07-06 03:25:02 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# -*- sh -*-
|
|
|
|
|
|
|
|
: <<EOF
|
|
|
|
|
|
|
|
=head1 NAME
|
|
|
|
|
|
|
|
ntp_kernel_pll_tol - Plugin to monitor the kernel's PLL frequency tolerance for
|
|
|
|
the NTP status
|
|
|
|
|
|
|
|
=head1 CONFIGURATION
|
|
|
|
|
|
|
|
No configuration
|
|
|
|
|
|
|
|
=head1 AUTHORS
|
|
|
|
|
2014-12-05 00:37:42 +01:00
|
|
|
Original authors unknown
|
2012-07-06 03:25:02 +02:00
|
|
|
ntp_kernel_pll_freq script patched by azet@azet.org for frequency tolerance support
|
|
|
|
|
|
|
|
=head1 LICENSE
|
|
|
|
|
|
|
|
Unknown license
|
|
|
|
|
|
|
|
=head1 BUGS
|
|
|
|
|
|
|
|
None known
|
|
|
|
|
|
|
|
=head1 MAGIC MARKERS
|
|
|
|
|
|
|
|
#%# family=auto
|
|
|
|
#%# capabilities=autoconf
|
|
|
|
|
|
|
|
=cut
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
if [ "$1" = "autoconf" ]; then
|
2018-08-02 02:03:42 +02:00
|
|
|
{ ntpq -c kerninfo; ntpdc -c kerninfo; } 2>/dev/null |
|
2012-07-06 03:25:02 +02:00
|
|
|
awk 'BEGIN { ev=1; }
|
2018-08-02 02:03:42 +02:00
|
|
|
/^frequency tolerance:/ { ev=0; }
|
2012-07-06 03:25:02 +02:00
|
|
|
END { if (ev == 0) { print "yes";} else { print "no"; } exit ev; }'
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$1" = "config" ]; then
|
|
|
|
echo 'graph_title NTP kernel PLL frequency tolerance (ppm)'
|
|
|
|
echo 'graph_args --alt-autoscale'
|
|
|
|
echo 'graph_vlabel PLL frequency (ppm)'
|
|
|
|
echo 'graph_category time'
|
|
|
|
echo 'graph_info The frequency tolerance of the kernel phase-locked loop used by NTP'
|
|
|
|
echo 'ntp_pll_tol.label pll-tolerance'
|
|
|
|
echo 'ntp_pll_tol.info Phase-locked loop frequency tolerance in parts per million'
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo -n 'ntp_pll_tol.value '
|
|
|
|
{ ntpq -c kerninfo; ntpdc -c kerninfo; } 2>/dev/null | awk '/^frequency tolerance:/ { print $3 }'
|