From d4294d219a484cf771a94029922f58efcbb237ac Mon Sep 17 00:00:00 2001 From: f Date: Mon, 14 Mar 2022 18:34:00 -0300 Subject: [PATCH] register to mmmonit with credentials --- monitrc | 5 ----- zeroconf.conf | 6 ++++++ zeroconf.sh | 2 ++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/monitrc b/monitrc index a51e485..40585f6 100644 --- a/monitrc +++ b/monitrc @@ -7,11 +7,6 @@ set statefile /var/lib/monit/state set eventqueue basedir /var/lib/monit/events slots 100 set limits { programoutput: 1 MB } -set httpd port 2812 - allow localhost - allow 172.0.0.0/8 - allow "fd00:acab::/32" - check program nsupdate with path "/usr/local/bin/nsupdate" every 1 cycle diff --git a/zeroconf.conf b/zeroconf.conf index a667bec..796147b 100644 --- a/zeroconf.conf +++ b/zeroconf.conf @@ -8,3 +8,9 @@ set mail-format { subject: $SERVICE@$HOST message: $ACTION $SERVICE -- $DATE -- $HOST: $DESCRIPTION. } + +set httpd port 2812 + allow localhost + allow 172.0.0.0/8 + allow "fd00:acab::/32" + allow @@CREDENTIALS@@ diff --git a/zeroconf.sh b/zeroconf.sh index 6652aaf..79b64f3 100755 --- a/zeroconf.sh +++ b/zeroconf.sh @@ -6,11 +6,13 @@ test ! -f /etc/monit.d/zeroconf.conf || exit 0 test -n "${EMAIL}" test -n "${EMAIL_FROM}" test -n "${MMONIT}" +test -n "${CREDENTIALS}" sed -re "s/@@EMAIL@@/${EMAIL}/" \ -e "s/@@EMAIL_FROM@@/${EMAIL_FROM}/" \ -e "s/@@HOSTNAME@@/${EMAIL_FROM#*@}/" \ -e "s/@@MMONIT@@/${MMONIT}/" \ + -e "s/@@CREDENTIALS@@/${CREDENTIALS}/" \ /etc/zeroconf.conf > /etc/monit.d/zeroconf.conf monit -t