3 # From: Marc Brett <Marc.Brett@westgeo.com>
5 # Here's a quick hack which can give you the stratum, delay, offset
6 # for any number of ntp servers.
8 NTPDATE
=/usr
/local
/bin
/ntpdate
9 NSLOOKUP
=/usr
/sbin
/nslookup
15 USAGE
="Usage: $0 hostname [hostname ...]"
23 trap '$RM -f $FILE; exit' 1 2 3 4 13 15
27 HOSTNAME
=`$NSLOOKUP $HOST | $EGREP "Name:" | $AWK '{print $2}'`
30 $NTPDATE -d $HOST 2>/dev
/null |
$EGREP '^stratum|^delay|^offset|^originate' > $FILE
31 STRATUM
=`$EGREP '^stratum' $FILE | $AWK '{print $2}'`
32 OFFSET
=`$EGREP '^offset' $FILE | $AWK '{print $2}'`
33 DELAY
=`$EGREP '^delay' $FILE | $AWK '{print $2}'`
34 TIMESTAMP
=`$EGREP '^originate' $FILE | $AWK '{print $4 " " $5 " " $6 " " $7 " " $8}'`
35 if [ "$STRATUM" -ne 0 ]
37 echo "$HOSTNAME: stratum:$STRATUM delay:$DELAY offset:$OFFSET $TIMESTAMP"
39 echo $HOSTNAME: Not running NTP