From be538dd94efcd7070c3bdf3afbd83c598fb58b20 Mon Sep 17 00:00:00 2001 From: andryyy Date: Tue, 23 Jun 2020 10:44:52 +0200 Subject: [PATCH] [Watchdog] Minor change to Dovecot health check --- data/Dockerfiles/watchdog/watchdog.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/data/Dockerfiles/watchdog/watchdog.sh b/data/Dockerfiles/watchdog/watchdog.sh index 8b34f2f3..d2e25e1a 100755 --- a/data/Dockerfiles/watchdog/watchdog.sh +++ b/data/Dockerfiles/watchdog/watchdog.sh @@ -458,7 +458,7 @@ dovecot_repl_checks() { progress "Dovecot replication" ${THRESHOLD} $(( ${THRESHOLD} - ${err_count} )) ${diff_c} if [[ $? == 10 ]]; then diff_c=0 - sleep 1 + sleep 60 else diff_c=0 sleep $(( ( RANDOM % 60 ) + 20 )) @@ -1008,15 +1008,19 @@ while true; do [[ ! -z ${WATCHDOG_NOTIFY_EMAIL} ]] && mail_error "${com_pipe_answer}" elif [[ ${com_pipe_answer} == "external_checks" ]]; then log_msg "Your mailcow is an open relay!" + # Define $2 to override message text, else print service was restarted at ... [[ ! -z ${WATCHDOG_NOTIFY_EMAIL} ]] && mail_error "${com_pipe_answer}" "Please stop mailcow now and check your network configuration!" elif [[ ${com_pipe_answer} == "mysql_repl_checks" ]]; then log_msg "MySQL replication is not working properly" - [[ ! -z ${WATCHDOG_NOTIFY_EMAIL} ]] && mail_error "${com_pipe_answer}" "Please check doveadm replicator status" + # Define $2 to override message text, else print service was restarted at ... + [[ ! -z ${WATCHDOG_NOTIFY_EMAIL} ]] && mail_error "${com_pipe_answer}" "Please check the SQL replication status" elif [[ ${com_pipe_answer} == "dovecot_repl_checks" ]]; then - log_msg "Dovecot replication is not working properly" "Please check doveadm replicator status" - [[ ! -z ${WATCHDOG_NOTIFY_EMAIL} ]] && mail_error "${com_pipe_answer}" + log_msg "Dovecot replication is not working properly" + # Define $2 to override message text, else print service was restarted at ... + [[ ! -z ${WATCHDOG_NOTIFY_EMAIL} ]] && mail_error "${com_pipe_answer}" "Please check the Dovecot replicator status" elif [[ ${com_pipe_answer} == "acme-mailcow" ]]; then log_msg "acme-mailcow did not complete successfully" + # Define $2 to override message text, else print service was restarted at ... [[ ! -z ${WATCHDOG_NOTIFY_EMAIL} ]] && mail_error "${com_pipe_answer}" "Please check acme-mailcow for further information." elif [[ ${com_pipe_answer} == "fail2ban" ]]; then F2B_RES=($(timeout 4s ${REDIS_CMDLINE} --raw GET F2B_RES 2> /dev/null))