Added ntpcheck
This commit is contained in:
parent
ec0a62aa18
commit
23a6bd21d5
1 changed files with 10 additions and 0 deletions
10
scripts/ntpcheck.sh
Executable file
10
scripts/ntpcheck.sh
Executable file
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
offset=$(/usr/sbin/ntpq -pn | /usr/bin/awk 'BEGIN { offset=1000 } $1 ~ /\*/ { offset=$9 } END { print offset }')
|
||||||
|
stratum=$(/usr/sbin/ntpq -pn | /usr/bin/awk 'BEGIN { stratum=99 } $1 ~ /\*/ { stratum=$3 } END { print stratum }')
|
||||||
|
peers=$(ntpq -pn | grep -E -c '^\*|^\+')
|
||||||
|
|
||||||
|
echo "- ntp.offset $offset"
|
||||||
|
echo "- ntp.stratum $stratum"
|
||||||
|
echo "- ntp.peers $peers"
|
||||||
|
|
Loading…
Reference in a new issue