Browse Source

[Watchdog] Send mail when starting
[Compose] Update watchdog and remove oom check for compatibility

andryyy 6 years ago
parent
commit
5be4885c15

+ 1 - 0
data/Dockerfiles/watchdog/Dockerfile

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

+ 5 - 1
data/Dockerfiles/watchdog/watchdog.sh

@@ -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

+ 2 - 2
docker-compose.yml

@@ -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}