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:
parent
54977029d5
commit
3b10114dda
1 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue