fuuko/go-neb: Notify room if alert is firing

This commit is contained in:
Simon Bruder 2021-04-08 10:04:30 +02:00
parent 9dbd7f9c85
commit 68fbc9e185
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC

View file

@ -26,9 +26,10 @@ in
webhook_url = "${baseUrl}/services/hooks/YWxlcnRtYW5hZ2VyX3NlcnZpY2U"; webhook_url = "${baseUrl}/services/hooks/YWxlcnRtYW5hZ2VyX3NlcnZpY2U";
rooms = { rooms = {
"!ceigaGYfREXXSeLFiH:sbruder.de" = { "!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 = '' html_template = ''
{{ range .Alerts }} {{ range .Alerts }}
{{- if eq .Status "firing" }}@room {{ end -}}
{{ $severity := index .Labels "severity" }} {{ $severity := index .Labels "severity" }}
<font{{ if eq .Status "firing" -}} <font{{ if eq .Status "firing" -}}
{{- if eq $severity "critical" }} color="red" {{- if eq $severity "critical" }} color="red"