register to mmmonit with credentials

This commit is contained in:
f 2022-03-14 18:34:00 -03:00
parent a615fdf509
commit d4294d219a
3 changed files with 8 additions and 5 deletions

View file

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

View file

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

View file

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