mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Add ntp_drift.
This commit is contained in:
parent
7fa8734a26
commit
ddced538d5
1 changed files with 85 additions and 0 deletions
85
plugins/ntp/ntp_drift
Executable file
85
plugins/ntp/ntp_drift
Executable file
|
@ -0,0 +1,85 @@
|
|||
#! /bin/sh
|
||||
# -*- sh -*-
|
||||
|
||||
: <<=cut
|
||||
|
||||
=head1 NAME
|
||||
|
||||
ntp_drift - Munin plugin to monitor the NTP drift value.
|
||||
|
||||
=head1 APPLICABLE SYSTEMS
|
||||
|
||||
Any ntpd host.
|
||||
|
||||
=head1 CONFIGURATION
|
||||
|
||||
The following configuration parameters are used by this plugin:
|
||||
|
||||
[ntp_drift]
|
||||
env.driftfile - Path to driftfile.
|
||||
|
||||
=head2 DEFAULT CONFIGURATION
|
||||
|
||||
[ntp_drift]
|
||||
env.driftfile "/var/lib/ntp/ntp.drift"
|
||||
|
||||
=head1 USAGE
|
||||
|
||||
Link this plugin to /etc/munin/plugins/ and restart the munin-node.
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
HORINOUCHI Masato <thermes+github@confei.to> 2019-07-16
|
||||
|
||||
=head1 LICENSE
|
||||
|
||||
Same as munin.
|
||||
|
||||
=head1 MAGIC MARKERS
|
||||
|
||||
#%# family=auto
|
||||
#%# capabilities=autoconf
|
||||
|
||||
=cut
|
||||
|
||||
driftfile=${driftfile:-'/var/lib/ntp/ntp.drift'}
|
||||
|
||||
do_autoconf () {
|
||||
if [ -r "$driftfile" ]; then
|
||||
echo "yes"
|
||||
else
|
||||
echo "no (could not read driftfile '$driftfile'.)"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
do_config () {
|
||||
cat <<'EOM'
|
||||
graph_title NTP drift
|
||||
graph_args --base 1000
|
||||
graph_vlabel Parts Per Million
|
||||
graph_category time
|
||||
drift.label Frequency Offset
|
||||
graph_info The frequency of the local clock oscillator. A single floating point number, which records the frequency offset measured in parts-per-million (PPM).
|
||||
EOM
|
||||
}
|
||||
|
||||
|
||||
do_ () {
|
||||
if [ -r "$driftfile" ]; then
|
||||
echo "drift.value $(cat "$driftfile")"
|
||||
else
|
||||
echo "drift.value U"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
case $1 in
|
||||
autoconf|config|'')
|
||||
do_"$1"
|
||||
;;
|
||||
*)
|
||||
echo "Don't know how to do that" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
Loading…
Add table
Add a link
Reference in a new issue