Fix in NTP plugins

This commit is contained in:
Patrick Van der Veken 2018-11-19 09:32:44 +01:00
parent 2069863dd6
commit 2b87e0dd6c
2 changed files with 18 additions and 0 deletions

View File

@ -115,6 +115,12 @@ fi
# evaluate ntpq results
# 1) active server
_NTP_PEER="$(grep -E -e '^\*' 2>/dev/null ${HC_STDOUT_LOG} | awk '{ print $1 }')"
if [[ -z "${_NTP_PEER}" ]]
then
_MSG="NTP is not synchronizing"
log_hc "$0" 1 "${_MSG}"
return 0
fi
case ${_NTP_PEER} in
\*127.127.1.0*)
_MSG="NTP is synchronizing against its internal clock"

View File

@ -249,6 +249,12 @@ then
# 1) active server
_CHRONY_PEER="$(grep -E -e '^\^,\*' 2>/dev/null ${HC_STDOUT_LOG} | cut -f3 -d',' 2>/dev/null)"
if [[ -z "${_CHRONY_PEER}" ]]
then
_MSG="chrony is not synchronizing"
log_hc "$0" 1 "${_MSG}"
return 0
fi
case ${_CHRONY_PEER} in
\*127.127.1.0*)
_MSG="chrony is synchronizing against its internal clock"
@ -298,6 +304,12 @@ else
# 1) active server
_NTP_PEER="$(grep -E -e '^\*' 2>/dev/null ${HC_STDOUT_LOG} | awk '{ print $1 }' 2>/dev/null)"
if [[ -z "${_NTP_PEER}" ]]
then
_MSG="NTP is not synchronizing"
log_hc "$0" 1 "${_MSG}"
return 0
fi
case ${_NTP_PEER} in
\*127.127.1.0*)
_MSG="NTP is synchronizing against its internal clock"