Fixup fromcvs/togit conversion
[pkgsrcv2.git] / sysutils / munin-node / files / node / node.d / ntp_kernel_pll_freq.in
1 #! /bin/sh
2 #
3 # $Id$
4 #
5 # Plugin to monitor the kernel's PLL frequency for the 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 [ -f @@CONFDIR@@/ntp-freq-comp ]; then
32     fcomp=`cat @@CONFDIR@@/ntp-freq-comp`
33 else
34     fcomp=0
35 fi
36
37 if [ "$1" = "config" ]; then
38     echo 'graph_title NTP kernel PLL frequency (ppm +' ${fcomp}')'
39 #    echo 'graph-args --logarithmic'
40     echo 'graph_args --alt-autoscale'
41     echo 'graph_vlabel PLL frequency (ppm +' ${fcomp}')'
42     echo 'graph_category other'
43     echo 'graph_info The frequency for the kernel phase-locked loop used by NTP'
44     echo 'ntp_pll_freq.label pll-freq'
45     echo 'ntp_pll_freq.info Phase-locked loop frequency in parts per million'
46     exit 0
47 fi
48
49 echo -n 'ntp_pll_freq.value '
50 ntpdc -c kern | awk -v fcomp=$fcomp '/^pll frequency:/ { print $3 + fcomp }'