Allow suppressing watchdog start notification.
The default behavior is still the old one (send a notifcation when the watchdog is started), but this notification can now be suppressed by setting WATCHDOG_NOTIFY_START=n.
This commit is contained in:
parent
f1c93fa337
commit
5425cca47e
@ -746,7 +746,7 @@ olefy_checks() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Notify about start
|
# Notify about start
|
||||||
if [[ ! -z ${WATCHDOG_NOTIFY_EMAIL} ]]; then
|
if [[ ! -z ${WATCHDOG_NOTIFY_EMAIL} ]] && [[ ${WATCHDOG_NOTIFY_START} =~ ^([yY][eE][sS]|[yY])+$ ]]; then
|
||||||
mail_error "watchdog-mailcow" "Watchdog started monitoring mailcow."
|
mail_error "watchdog-mailcow" "Watchdog started monitoring mailcow."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -488,6 +488,7 @@ services:
|
|||||||
- USE_WATCHDOG=${USE_WATCHDOG:-n}
|
- USE_WATCHDOG=${USE_WATCHDOG:-n}
|
||||||
- WATCHDOG_NOTIFY_EMAIL=${WATCHDOG_NOTIFY_EMAIL:-}
|
- WATCHDOG_NOTIFY_EMAIL=${WATCHDOG_NOTIFY_EMAIL:-}
|
||||||
- WATCHDOG_NOTIFY_BAN=${WATCHDOG_NOTIFY_BAN:-y}
|
- WATCHDOG_NOTIFY_BAN=${WATCHDOG_NOTIFY_BAN:-y}
|
||||||
|
- WATCHDOG_NOTIFY_START=${WATCHDOG_NOTIFY_START:-y}
|
||||||
- WATCHDOG_SUBJECT=${WATCHDOG_SUBJECT:-Watchdog ALERT}
|
- WATCHDOG_SUBJECT=${WATCHDOG_SUBJECT:-Watchdog ALERT}
|
||||||
- WATCHDOG_EXTERNAL_CHECKS=${WATCHDOG_EXTERNAL_CHECKS:-n}
|
- WATCHDOG_EXTERNAL_CHECKS=${WATCHDOG_EXTERNAL_CHECKS:-n}
|
||||||
- WATCHDOG_MYSQL_REPLICATION_CHECKS=${WATCHDOG_MYSQL_REPLICATION_CHECKS:-n}
|
- WATCHDOG_MYSQL_REPLICATION_CHECKS=${WATCHDOG_MYSQL_REPLICATION_CHECKS:-n}
|
||||||
|
@ -401,6 +401,9 @@ USE_WATCHDOG=y
|
|||||||
# Notify about banned IP (includes whois lookup)
|
# Notify about banned IP (includes whois lookup)
|
||||||
WATCHDOG_NOTIFY_BAN=n
|
WATCHDOG_NOTIFY_BAN=n
|
||||||
|
|
||||||
|
# Send a notification when the watchdog is started.
|
||||||
|
WATCHDOG_NOTIFY_START=y
|
||||||
|
|
||||||
# Subject for watchdog mails. Defaults to "Watchdog ALERT" followed by the error message.
|
# Subject for watchdog mails. Defaults to "Watchdog ALERT" followed by the error message.
|
||||||
#WATCHDOG_SUBJECT=
|
#WATCHDOG_SUBJECT=
|
||||||
|
|
||||||
|
@ -449,6 +449,7 @@ CONFIG_ARRAY=(
|
|||||||
"USE_WATCHDOG"
|
"USE_WATCHDOG"
|
||||||
"WATCHDOG_NOTIFY_EMAIL"
|
"WATCHDOG_NOTIFY_EMAIL"
|
||||||
"WATCHDOG_NOTIFY_BAN"
|
"WATCHDOG_NOTIFY_BAN"
|
||||||
|
"WATCHDOG_NOTIFY_START"
|
||||||
"WATCHDOG_EXTERNAL_CHECKS"
|
"WATCHDOG_EXTERNAL_CHECKS"
|
||||||
"WATCHDOG_SUBJECT"
|
"WATCHDOG_SUBJECT"
|
||||||
"SKIP_CLAMD"
|
"SKIP_CLAMD"
|
||||||
@ -636,6 +637,12 @@ for option in ${CONFIG_ARRAY[@]}; do
|
|||||||
echo '# Notify about banned IP. Includes whois lookup.' >> mailcow.conf
|
echo '# Notify about banned IP. Includes whois lookup.' >> mailcow.conf
|
||||||
echo "WATCHDOG_NOTIFY_BAN=y" >> mailcow.conf
|
echo "WATCHDOG_NOTIFY_BAN=y" >> mailcow.conf
|
||||||
fi
|
fi
|
||||||
|
elif [[ ${option} == "WATCHDOG_NOTIFY_START" ]]; then
|
||||||
|
if ! grep -q ${option} mailcow.conf; then
|
||||||
|
echo "Adding new option \"${option}\" to mailcow.conf"
|
||||||
|
echo '# Send a notification when the watchdog is started.' >> mailcow.conf
|
||||||
|
echo "WATCHDOG_NOTIFY_START=y" >> mailcow.conf
|
||||||
|
fi
|
||||||
elif [[ ${option} == "WATCHDOG_SUBJECT" ]]; then
|
elif [[ ${option} == "WATCHDOG_SUBJECT" ]]; then
|
||||||
if ! grep -q ${option} mailcow.conf; then
|
if ! grep -q ${option} mailcow.conf; then
|
||||||
echo "Adding new option \"${option}\" to mailcow.conf"
|
echo "Adding new option \"${option}\" to mailcow.conf"
|
||||||
|
Loading…
Reference in New Issue
Block a user