summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Lewkowski <michael@lewkowski.de>2016-06-01 09:03:54 +0200
committerMichael Lewkowski <michael@lewkowski.de>2016-06-01 09:03:54 +0200
commitc88f6adeb932998772b12545b7ace69578275150 (patch)
tree8537316ef3e812ef8c36a60f54cda28b591fc703
parenta1fe06d2383628d71e265acc9be544159a413cc1 (diff)
downloadmunin-c88f6adeb932998772b12545b7ace69578275150.tar.gz
munin-c88f6adeb932998772b12545b7ace69578275150.tar.bz2
munin-c88f6adeb932998772b12545b7ace69578275150.tar.xz
munin-c88f6adeb932998772b12545b7ace69578275150.zip
exported smtp_message as configuration parameter
-rw-r--r--start-munin.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/start-munin.sh b/start-munin.sh
index a7209f7..58b3d0a 100644
--- a/start-munin.sh
+++ b/start-munin.sh
@@ -6,6 +6,8 @@ MUNIN_PASSWORD=${MUNIN_PASSWORD:-password}
MAIL_CONF_PATH='/var/lib/munin/.mailrc'
SMTP_USE_TLS=${SMTP_USE_TLS:-false}
SMTP_ALWAYS_SEND=${SMTP_ALWAYS_SEND:-true}
+SMTP_MESSAGE_DEFAULT='[${var:group};${var:host}] -> ${var:graph_title} -> warnings: ${loop<,>:wfields ${var:label}=${var:value}} / criticals: ${loop<,>:cfields ${var:label}=${var:value}}'
+SMTP_MESSAGE="${SMTP_MESSAGE:-$SMTP_MESSAGE_DEFAULT}"
truncate -s 0 "${MAIL_CONF_PATH}"
@@ -33,7 +35,7 @@ fi
grep -q 'contact.mail' /etc/munin/munin.conf; rc=$?
if [ $rc -ne 0 -a -n "${ALERT_RECIPIENT}" -a -n "${ALERT_SENDER}" ] ; then
echo "Setup alert email from ${ALERT_SENDER} to ${ALERT_RECIPIENT}"
- echo 'contact.mail.command mail -r '${ALERT_SENDER}' -s "[${var:group};${var:host}] -> ${var:graph_title} -> warnings: ${loop<,>:wfields ${var:label}=${var:value}} / criticals: ${loop<,>:cfields ${var:label}=${var:value}}"' ${ALERT_RECIPIENT} >> /etc/munin/munin.conf
+ echo "contact.mail.command mail -r ${ALERT_SENDER} -s ${SMTP_MESSAGE} ${ALERT_RECIPIENT}" >> /etc/munin/munin.conf
if [ "${SMTP_ALWAYS_SEND}" = true ] ; then
echo 'contact.mail.always_send warning critical' >> /etc/munin/munin.conf
fi