summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/shack/prometheus/templates
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2020-09-14 16:56:30 +0200
committermakefu <github@syntax-fehler.de>2020-09-14 16:56:30 +0200
commit1394ae1bd4bc3dcfb77b0daee996e75f8092fc5b (patch)
treefd1490637685f583a236cc45103d5550563b949a /krebs/2configs/shack/prometheus/templates
parent88aee4087ebf00e32b39476ddbd82c7e69490280 (diff)
shack/prometheus: add custom shack template
Diffstat (limited to 'krebs/2configs/shack/prometheus/templates')
-rw-r--r--krebs/2configs/shack/prometheus/templates/shack.tmpl25
1 files changed, 25 insertions, 0 deletions
diff --git a/krebs/2configs/shack/prometheus/templates/shack.tmpl b/krebs/2configs/shack/prometheus/templates/shack.tmpl
new file mode 100644
index 000000000..9295f019f
--- /dev/null
+++ b/krebs/2configs/shack/prometheus/templates/shack.tmpl
@@ -0,0 +1,25 @@
+{{ define "telegram.default" }}
+{{range .Alerts -}}
+{{ $severity := index .Labels "severity" }}
+{{ $desc := "No Description" }}
+{{ if eq .Status "firing" }}
+ {{ $desc = index .Annotations "description" }}
+ {{- if eq $severity "critical" -}}
+ <i><u><b>[CRITICAL]</b></u></i>
+ {{- else if eq $severity "warning" -}}
+ <u><b>[WARNING]</b></u>
+ {{- else -}}
+ <b>[{{ $severity }}]</b>
+ {{- end -}}
+{{ else -}}
+ {{ $desc = "The issue has been resolved" }}
+ <del>[RESOLVED]</del>
+{{- end }} {{ index .Labels "alertname"}}: {{ index .Annotations "summary"}}
+
+{{ $desc }}
+
+Alert Links:
+* <a href="{{ index .Annotations "url"}}">Grafana</a>
+* <a href="{{ .GeneratorURL }}">Source</a>
+{{end -}}
+{{end}}