From 68fbc9e185d63152a51092e2db6be62737c5ea62 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Thu, 8 Apr 2021 10:04:30 +0200 Subject: [PATCH] fuuko/go-neb: Notify room if alert is firing --- machines/fuuko/services/matrix/go-neb.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/machines/fuuko/services/matrix/go-neb.nix b/machines/fuuko/services/matrix/go-neb.nix index f455eb5..5b67b87 100644 --- a/machines/fuuko/services/matrix/go-neb.nix +++ b/machines/fuuko/services/matrix/go-neb.nix @@ -26,9 +26,10 @@ in webhook_url = "${baseUrl}/services/hooks/YWxlcnRtYW5hZ2VyX3NlcnZpY2U"; rooms = { "!ceigaGYfREXXSeLFiH:sbruder.de" = { - text_template = "{{ range .Alerts }}[{{ .Status }}] {{ index .Labels \"alertname\" }}: {{ index .Annotations \"description\" }}\n{{ end }}"; + text_template = "{{ range .Alerts }}{{ if eq .Status \"firing\" }}@room {{ end }}[{{ .Status }}] {{ index .Labels \"alertname\" }}: {{ index .Annotations \"description\" }}\n{{ end }}"; html_template = '' {{ range .Alerts }} + {{- if eq .Status "firing" }}@room {{ end -}} {{ $severity := index .Labels "severity" }}