root / plugins / time / ntp_kernel_pll_prec @ 81db94e2
Historique | Voir | Annoter | Télécharger (1,16 ko)
| 1 |
#!/bin/sh |
|---|---|
| 2 |
# -*- sh -*- |
| 3 |
|
| 4 |
: <<EOF |
| 5 |
|
| 6 |
=head1 NAME |
| 7 |
|
| 8 |
ntp_kernel_pll_prec - Plugin to monitor the kernel's PLL precision for |
| 9 |
the NTP status |
| 10 |
|
| 11 |
=head1 CONFIGURATION |
| 12 |
|
| 13 |
No configuration |
| 14 |
|
| 15 |
=head1 AUTHORS |
| 16 |
|
| 17 |
Original authors unknown |
| 18 |
ntp_kernel_pll_freq patched for PLL precision support by azet@azet.org |
| 19 |
|
| 20 |
=head1 LICENSE |
| 21 |
|
| 22 |
Unknown |
| 23 |
|
| 24 |
=head1 BUGS |
| 25 |
|
| 26 |
None Known |
| 27 |
|
| 28 |
=head1 MAGIC MARKERS |
| 29 |
|
| 30 |
#%# family=auto |
| 31 |
#%# capabilities=autoconf |
| 32 |
|
| 33 |
=cut |
| 34 |
|
| 35 |
EOF |
| 36 |
|
| 37 |
if [ "$1" = "autoconf" ]; then |
| 38 |
{ ntpq -c kerninfo; ntpdc -c kerninfo; } 2>/dev/null |
|
| 39 |
awk 'BEGIN { ev=1; }
|
| 40 |
/^precision:/ { ev=0; }
|
| 41 |
END { if (ev == 0) { print "yes";} else { print "no"; } exit ev; }'
|
| 42 |
exit 0 |
| 43 |
fi |
| 44 |
|
| 45 |
if [ "$1" = "config" ]; then |
| 46 |
echo 'graph_title NTP kernel PLL precision' |
| 47 |
echo 'graph_args --alt-autoscale' |
| 48 |
echo 'graph_vlabel PLL precision' |
| 49 |
echo 'graph_category time' |
| 50 |
echo 'graph_info The precision of the kernel phase-locked loop used by NTP' |
| 51 |
echo 'ntp_pll_prec.label pll-precision' |
| 52 |
echo 'ntp_pll_prec.info Phase-locked loop precision in seconds' |
| 53 |
exit 0 |
| 54 |
fi |
| 55 |
CALL=`{ ntpq -c kerninfo; ntpdc -c kerninfo; } 2>/dev/null | awk '/^precision:/ { print $2 }'`
|
| 56 |
printf "ntp_pll_prec.value %.23f" ${CALL} ; echo
|
