[Watchdog] Send mail when starting

[Compose] Update watchdog and remove oom check for compatibility
This commit is contained in:
andryyy 2019-04-18 22:09:26 +02:00
parent 9f00d956f1
commit 5be4885c15
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
3 changed files with 8 additions and 3 deletions

View File

@ -12,6 +12,7 @@ RUN apk add --update \
coreutils \
jq \
fcgi \
openssl \
nagios-plugins-mysql \
nagios-plugins-dns \
nagios-plugins-disk \

View File

@ -58,9 +58,10 @@ function mail_error() {
log_msg "Cannot determine MX for ${rcpt}, skipping email notification..."
return 1
fi
[[ ${1} == "watchdog-mailcow" ]] && SUBJECT="Watchdog started" || SUBJECT="Watchdog: ${1} hit the error rate limit"
[ -f "/tmp/${1}" ] && ATTACH="--attach /tmp/${1}@text/plain" || ATTACH=
./smtp-cli --missing-modules-ok \
--subject="Watchdog: ${1} hit the error rate limit" \
--subject="${SUBJECT}" \
--body-plain="${BODY}" \
--to=${rcpt} \
--from="watchdog@${MAILCOW_HOSTNAME}" \
@ -447,6 +448,9 @@ Empty
return 1
}
# Notify about start
[[ ! -z ${WATCHDOG_NOTIFY_EMAIL} ]] && mail_error "watchdog-mailcow" "Watchdog started monitoring mailcow."
# Create watchdog agents
(
while true; do

View File

@ -359,14 +359,14 @@ services:
- /lib/modules:/lib/modules:ro
watchdog-mailcow:
image: mailcow/watchdog:1.40
image: mailcow/watchdog:1.41
# Debug
#command: /watchdog.sh
build: ./data/Dockerfiles/watchdog
oom_kill_disable: true
volumes:
- rspamd-vol-1:/var/lib/rspamd
- mysql-socket-vol-1:/var/run/mysqld/
- ./data/assets/ssl:/etc/ssl/mail/:ro
restart: always
environment:
- LOG_LINES=${LOG_LINES:-9999}