mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-24 18:07:20 +00:00
More housecleaning.
Collapse some categories; remove duplicates; move plugins in where they belong, remove files that are not really plugins at all.
This commit is contained in:
parent
4e3ef5b93e
commit
0a1524f27f
45 changed files with 0 additions and 1337 deletions
49
plugins/time/ntpdate_
Executable file
49
plugins/time/ntpdate_
Executable file
|
@ -0,0 +1,49 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Plugin to monitor clock offset and delay, using ntpdate
|
||||
#
|
||||
# Parameters understood:
|
||||
#
|
||||
# config (required)
|
||||
#
|
||||
# Author: Rune Nordbøe Skillingstad <rune.skillingstad@ntnu.no>
|
||||
#
|
||||
# Magic markers - optional - used by installation scripts and
|
||||
# munin-node-configure:
|
||||
#
|
||||
#%# family=manual
|
||||
#%# capabilities=
|
||||
#
|
||||
|
||||
NTPDATE="/usr/sbin/ntpdate"
|
||||
PEER=$(basename $0 | sed -e 's/^ntpdate_//' -e 's/_/./g')
|
||||
|
||||
if [ ! -x "$NTPDATE" ]; then
|
||||
echo "Can't find ntpdate executable"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$PEER" = "" ]; then
|
||||
echo "Unknown peer"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$1" = "config" ]; then
|
||||
echo "graph_title NTP offset and delay to peer $PEER"
|
||||
echo "graph_args --base 1000 --vertical-label msec"
|
||||
echo "offset.label Offset"
|
||||
echo "offset.draw LINE2"
|
||||
echo "delay.label Delay"
|
||||
echo "delay.draw LINE2"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
LANG=en_US
|
||||
DATA=($($NTPDATE -q $PEER | awk '/^server.*offset/{gsub(/,/,"");if(dela==0||$8<dela){offs=$6;dela=$8;}}END{print offs*1000,dela*1000;}'))
|
||||
|
||||
[ -z "$DATA" -o "x$DATA" = "x0" ] && exit 1
|
||||
echo "offset.value ${DATA[0]}"
|
||||
echo "delay.value ${DATA[1]}"
|
||||
|
||||
exit 0
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue