From e67c05b2b1583b6a131b23114f6a899825ef43da Mon Sep 17 00:00:00 2001
From: Bilal Ahmad <bahmad@edx.org>
Date: Thu, 11 Aug 2016 16:13:55 +0500
Subject: [PATCH] addressing comments

---
 playbooks/roles/common/templates/log-ntp-alerts.sh.j2 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/playbooks/roles/common/templates/log-ntp-alerts.sh.j2 b/playbooks/roles/common/templates/log-ntp-alerts.sh.j2
index 4b93928..a1a7bae 100644
--- a/playbooks/roles/common/templates/log-ntp-alerts.sh.j2
+++ b/playbooks/roles/common/templates/log-ntp-alerts.sh.j2
@@ -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
--
libgit2 0.26.0