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

fixed issue when more than one server is asked (e.g. pool.ntp.org)

This commit is contained in:
Stefan Seidel 2010-06-22 17:25:32 +02:00 committed by Steve Schnepp
parent 27d5ca531a
commit b132ffc0f1

View file

@ -38,7 +38,7 @@ if [ "$1" = "config" ]; then
exit 0
fi
DATA=($($NTPDATE -q $PEER | awk '/^server.*offset/{gsub(/,/,"");printf "%s %s", ($6*1000), ($8*1000);}'))
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]}