From b21f1118d099ca055748e6fdc5d2bfc9ac13af9e Mon Sep 17 00:00:00 2001 From: Alex Garel Date: Wed, 14 Feb 2024 17:03:34 +0100 Subject: [PATCH] feat: enable adding severity to alert email --- confs/common/systemd/system/email-failures@.service | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/confs/common/systemd/system/email-failures@.service b/confs/common/systemd/system/email-failures@.service index c74fd639..9d3606b7 100644 --- a/confs/common/systemd/system/email-failures@.service +++ b/confs/common/systemd/system/email-failures@.service @@ -6,6 +6,7 @@ Description=%i failure email notification on %l [Service] Type=oneshot # replace __ by @ in instance name to be able to call status on a specific instance +# also eventually adds the ALERT_PREFIX if present in env # then use mailx to email status (apt install bsd-mailx if needed) -ExecStart=/bin/bash -c 'HOST_NAME=%H; INSTANCE_NAME=%i; SERVICE_NAME=$${INSTANCE_NAME//__/@}; /bin/systemctl status $$SERVICE_NAME | /usr/bin/mailx -s "[$$HOST_NAME][$$SERVICE_NAME] failure notification" root' +ExecStart=/bin/bash -c 'HOST_NAME=%H; INSTANCE_NAME=%i; SERVICE_NAME=$${INSTANCE_NAME//__/@}; /bin/systemctl status $$SERVICE_NAME | /usr/bin/mailx -s "$$ALERT_PREFIX[$$HOST_NAME][$$SERVICE_NAME] failure notification" root'