0a28bfa615ec1b42a78fb7caa2e2c716b21512bc
[pkgsrcv2.git] / sysutils / munin-node / files / node / node.d / ntp_kernel_err.in
1 #! /bin/sh
2 #
3 # $Id: ntp_kernel_err.in,v 1.1.1.1 2006/06/04 20:53:57 he Exp $
4 #
5 # Plugin to monitor the estimated error for the kernel NTP
6 # status.
7 #
8 # Usage: Link or copy into /etc/munin/node.d/
9 #
10 # Magic markers (optional - only used by munin-config and some
11 # installation scripts):
12 #
13 #%# family=manual
14 #%# capabilities=autoconf
15
16 # If run with the "autoconf"-parameter, give our opinion on wether we
17 # should be run on this system or not. This is optinal, and only used by
18 # munin-config. In the case of this plugin, we should most probably
19 # always be included.
20
21 if [ "$1" = "autoconf" ]; then
22     if ntpdc -c help >/dev/null 2>&1; then
23         echo yes
24         exit 0
25     else
26         echo no
27         exit 1
28     fi
29 fi
30
31 if [ "$1" = "config" ]; then
32     echo 'graph_title NTP kernel PLL estimated error (secs)'
33 #    echo 'graph_args --logarithmic'
34     echo 'graph_vlabel est. err (secs)'
35     echo 'graph_category other'
36     echo 'graph_info The kernels estimated error for the phase-locked loop used by NTP'
37     echo 'ntp_err.label est-error'
38     echo 'ntp_err.info Estimated error for the kernel PLL'
39     exit 0
40 fi
41
42 echo -n 'ntp_err.value '
43 ntpdc -c kern | awk '/^estimated error:/ { print $3 }'