Vadim Surkov 5 years ago
parent
commit
08b9a6da25
1 changed files with 2 additions and 2 deletions
  1. 2 2
      healthcheck.sh

+ 2 - 2
healthcheck.sh

@@ -8,7 +8,7 @@ _LOGDIR="/opt/analis/log"
 _LOGFILE=$( ls -t -d -1 ${_LOGDIR}/Analis* | head -1 )
 
 #Check difference between system time and latest modified file in logdir - if it's greater then $_LOGDIFF, then container is not healty
-if [[  $[ $(date +%s) - $(stat -c %Y "${_LOGFILE}"") ] -gt ${_LOGDIFF} ]]; then
-   echo $(date)" The difference between system time and latest modified file in logdir is "$[ $(date +%s) - $(stat -c %Y ${_LOGFILE}) ]" The service seems to be unhealty." >> ${_LOGDIR}/healthcheck.log
+if [[  $[ $(date +%s) - $(stat -c %Y "${_LOGFILE}") ] -gt ${_LOGDIFF} ]]; then
+   echo -e $(date)" The difference between system time and latest modified file in logdir is "$[ $(date +%s) - $(stat -c %Y ${_LOGFILE}) ]" The service seems to be unhealty.\n\r" >> ${_LOGDIR}/healthcheck.log
    exit 1
 fi