1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-25 02:18:08 +00:00

Fixed spelling mistake and erronous values when ntp server is not available - this might leave some empty spots in the graph, but at least won't read false values.

This commit is contained in:
Stefan Seidel 2010-07-06 10:22:50 +02:00 committed by Steve Schnepp
parent 54977029d5
commit 3b10114dda

View file

@ -29,7 +29,7 @@ if [ "$PEER" = "" ]; then
fi
if [ "$1" = "config" ]; then
echo "graph_title NTP offset and dealy to peer $PEER"
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"
@ -38,10 +38,12 @@ if [ "$1" = "config" ]; then
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;}'))
echo "offset.value "${DATA[0]}
echo "delay.value "${DATA[1]}
[ -z "$DATA" -o "x$DATA" = "x0" ] && exit 1
echo "offset.value ${DATA[0]}"
echo "delay.value ${DATA[1]}"
exit 0