diff --git a/Dockerfile b/Dockerfile index af250ea..caddc3b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,10 @@ FROM alpine:3.10 MAINTAINER "f " +# TODO: We don't want to receive lots of email, so we'll change this to +# a pingy instance that will also work as a status site. +ENV EMAIL monit@sutty.nl + # Install monit and remove default config RUN apk add --no-cache tini monit && rm -f /etc/monitrc diff --git a/allow_networks.sh b/allow_networks.sh index 103548b..71edd1e 100644 --- a/allow_networks.sh +++ b/allow_networks.sh @@ -14,5 +14,8 @@ ip route \ # Put in place mv /etc/monit.d/monit.conf~ /etc/monit.d/monit.conf +# Configure email +grep -q "${EMAIL}" || echo "set alert ${EMAIL}" >> /etc/monitrc + # Reload config monit reload diff --git a/monitrc b/monitrc index c1e29a7..61620a8 100644 --- a/monitrc +++ b/monitrc @@ -5,6 +5,8 @@ set pidfile /run/monit.pid set idfile /var/lib/monit/id set statefile /var/lib/monit/state set eventqueue basedir /var/lib/monit/events slots 100 +set mailserver postfix +set limits { programoutput: 1 MB } check program allow_networks with path "/usr/local/bin/allow_networks"