mirror of
https://github.com/munin-monitoring/muninlite.git
synced 2024-11-16 16:48:33 +01:00
6eb9e91c1f
git-svn-id: svn://svn.code.sf.net/p/muninlite/code/muninlite@16 35caa317-6b62-4e8a-81c0-b04f0c356266
21 lines
566 B
Text
21 lines
566 B
Text
config_ntpdate() {
|
|
echo "graph_title NTP offset and dealy to peer $NTP_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"
|
|
}
|
|
|
|
fetch_ntpdate() {
|
|
NTPDATE="/usr/sbin/ntpdate"
|
|
DATA=(0 0)
|
|
if [ "$NTP_PEER" != "" ]; then
|
|
if [ -x "$NTPDATE" ]; then
|
|
DATA=($($NTPDATE -q $NTP_PEER | awk '/^server.*offset/{gsub(/,/,"");printf "%s %s", ($6*1000), ($8*1000);}'))
|
|
fi
|
|
fi
|
|
echo "offset.value "${DATA[0]}
|
|
echo "delay.value "${DATA[1]}
|
|
}
|
|
|