Commit e67c05b2 by Bilal Ahmad

addressing comments

parent bb50bb7a
......@@ -3,14 +3,14 @@
log_directory={{ COMMON_LOG_DIR }}
reach=$(ntpq -c associations | awk '{print $5}' | grep yes)
if [[ ${reach} == *"no"* ]]; then
echo $(date -u) "NTPD not synchronized - Please investigate" >> ${log_directory}/ntp.log
echo $(date -u) $(hostname) "NTPD not synchronized - Please investigate" >> ${log_directory}/ntp.log
fi
limit=100 # limit in milliseconds
offsets=$(ntpq -nc peers | tail -n +3 | cut -c 62-66 | tr -d '-')
for offset in ${offsets}; do
if [ ${offset:-0} -ge ${limit:-100} ]; then
echo $(date -u) "An NTPD offset is excessive - Please investigate" >> ${log_directory}/ntp.log
echo $(date -u) $(hostname) "An NTPD offset with value $offset is excessive - Please investigate" >> ${log_directory}/ntp.log
exit 1
fi
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment