Permalink
Browse files

kernel PPL precision and frequency tolerance graphing support for munin

  • Loading branch information...
0 parents commit 5e28243511338b572f863848627dae2176b6d52d @azet committed May 11, 2012
Showing with 114 additions and 0 deletions.
  1. +57 −0 ntp_kernel_pll_prec
  2. +57 −0 ntp_kernel_pll_tol
@@ -0,0 +1,57 @@
+#!/bin/sh
+# -*- sh -*-
+
+: <<EOF
+
+=head1 NAME
+
+ntp_kernel_pll_freq - Plugin to monitor the kernel's PLL precision for
+the NTP status
+
+=head1 CONFIGURATION
+
+No configuration
+
+=head1 AUTHORS
+
+Original authors unknown
+ntp_kernel_pll_freq patched for PLL precision support by azet@azet.org
+
+=head1 LICENSE
+
+Unknown
+
+=head1 BUGS
+
+None Known
+
+=head1 MAGIC MARKERS
+
+ #%# family=auto
+ #%# capabilities=autoconf
+
+=cut
+
+EOF
+
+if [ "$1" = "autoconf" ]; then
+ ntpdc -c kern 2>/dev/null |
+ awk 'BEGIN { ev=1; }
+ /^precision:/ { ev=0; }
+ END { if (ev == 0) { print "yes";} else { print "no"; } exit ev; }'
+ exit 0
+fi
+
+if [ "$1" = "config" ]; then
+ echo 'graph_title NTP kernel PLL precision'
+ echo 'graph_args --alt-autoscale'
+ echo 'graph_vlabel PLL precision'
+ echo 'graph_category time'
+ echo 'graph_info The precision of the kernel phase-locked loop used by NTP'
+ echo 'ntp_pll_prec.label pll-freq'
+ echo 'ntp_pll_prec.info Phase-locked loop precision in seconds'
+ exit 0
+fi
+
+echo -n 'ntp_pll_prec.value '
+ntpdc -c kern | awk '/^precision:/ { print $2 }'
@@ -0,0 +1,57 @@
+#!/bin/sh
+# -*- sh -*-
+
+: <<EOF
+
+=head1 NAME
+
+ntp_kernel_pll_freq - Plugin to monitor the kernel's PLL frequency tolerance for
+the NTP status
+
+=head1 CONFIGURATION
+
+No configuration
+
+=head1 AUTHORS
+
+Original authors unkown
+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
+ ntpdc -c kern 2>/dev/null |
+ awk 'BEGIN { ev=1; }
+ /^frequency tolerance:/ { ev=0; }
+ 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 '
+ntpdc -c kern | awk '/^frequency tolerance:/ { print $3 }'

0 comments on commit 5e28243

Please sign in to comment.