ntp_server 466 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10
#!/bin/sh

if [ "$1" = "autoconf" ]; then
        echo yes
        exit 0
fi

if [ "$1" = "config" ]; then
        echo "graph_title NTP servers offset"
        echo 'graph_args --base 1000 -l 0 '
Xavier Lagorce's avatar
Xavier Lagorce committed
11
        echo 'graph_vlabel offset in µsec'
12 13 14 15 16 17 18
	ntpq -p | grep -i '^[*+-]' | awk '{gsub("^.","",$1) ; gsub("[.-]", "_", $1); print $1 ".label " $1}'
        exit 0
fi;

ntpq -p | grep -i '^[*+-]' | awk '{gsub("^.","",$1) ; gsub("[.-]", "_", $1); print $1 ".value " $9}'