mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2024-12-09 08:50:05 +08:00
[Watchdog] Send mail when starting
[Compose] Update watchdog and remove oom check for compatibility
This commit is contained in:
parent
9f00d956f1
commit
5be4885c15
@ -12,6 +12,7 @@ RUN apk add --update \
|
||||
coreutils \
|
||||
jq \
|
||||
fcgi \
|
||||
openssl \
|
||||
nagios-plugins-mysql \
|
||||
nagios-plugins-dns \
|
||||
nagios-plugins-disk \
|
||||
|
@ -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
|
||||
|
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user