2020-08-12 15:53:56 +00:00
|
|
|
{{ define "__alertmanager" }}Alertmanager{{ end }}
|
2019-08-28 08:01:47 +00:00
|
|
|
{{ define "__alertmanagerURL" }}{{ .ExternalURL }}/#/alerts?receiver={{ .Receiver | urlquery }}{{ end }}
|
2015-11-26 17:19:46 +00:00
|
|
|
|
2015-11-30 17:00:38 +00:00
|
|
|
{{ define "__subject" }}[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}] {{ .GroupLabels.SortedPairs.Values | join " " }} {{ if gt (len .CommonLabels) (len .GroupLabels) }}({{ with .CommonLabels.Remove .GroupLabels.Names }}{{ .Values | join " " }}{{ end }}){{ end }}{{ end }}
|
2015-11-26 17:19:46 +00:00
|
|
|
{{ define "__description" }}{{ end }}
|
|
|
|
|
2016-01-05 19:52:08 +00:00
|
|
|
{{ define "__text_alert_list" }}{{ range . }}Labels:
|
2015-11-30 17:00:38 +00:00
|
|
|
{{ range .Labels.SortedPairs }} - {{ .Name }} = {{ .Value }}
|
2016-01-05 19:52:08 +00:00
|
|
|
{{ end }}Annotations:
|
2015-11-30 17:00:38 +00:00
|
|
|
{{ range .Annotations.SortedPairs }} - {{ .Name }} = {{ .Value }}
|
2016-02-16 14:58:18 +00:00
|
|
|
{{ end }}Source: {{ .GeneratorURL }}
|
2015-11-26 17:19:46 +00:00
|
|
|
{{ end }}{{ end }}
|
|
|
|
|
2023-06-08 15:27:56 +00:00
|
|
|
{{ define "__text_alert_list_markdown" }}{{ range . }}
|
|
|
|
Labels:
|
|
|
|
{{ range .Labels.SortedPairs }} - {{ .Name }} = {{ .Value }}
|
|
|
|
{{ end }}
|
|
|
|
Annotations:
|
|
|
|
{{ range .Annotations.SortedPairs }} - {{ .Name }} = {{ .Value }}
|
|
|
|
{{ end }}
|
|
|
|
Source: {{ .GeneratorURL }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
2015-10-11 11:32:34 +00:00
|
|
|
|
2015-11-25 14:49:26 +00:00
|
|
|
{{ define "slack.default.title" }}{{ template "__subject" . }}{{ end }}
|
2015-11-30 12:52:41 +00:00
|
|
|
{{ define "slack.default.username" }}{{ template "__alertmanager" . }}{{ end }}
|
|
|
|
{{ define "slack.default.fallback" }}{{ template "slack.default.title" . }} | {{ template "slack.default.titlelink" . }}{{ end }}
|
2018-10-23 09:22:23 +00:00
|
|
|
{{ define "slack.default.callbackid" }}{{ end }}
|
2015-10-29 13:34:24 +00:00
|
|
|
{{ define "slack.default.pretext" }}{{ end }}
|
2015-11-26 17:19:46 +00:00
|
|
|
{{ define "slack.default.titlelink" }}{{ template "__alertmanagerURL" . }}{{ end }}
|
2016-02-16 10:54:30 +00:00
|
|
|
{{ define "slack.default.iconemoji" }}{{ end }}
|
2016-05-12 18:51:22 +00:00
|
|
|
{{ define "slack.default.iconurl" }}{{ end }}
|
2015-11-30 12:52:41 +00:00
|
|
|
{{ define "slack.default.text" }}{{ end }}
|
2017-12-12 21:50:41 +00:00
|
|
|
{{ define "slack.default.footer" }}{{ end }}
|
2015-10-11 11:32:34 +00:00
|
|
|
|
2015-11-26 17:19:46 +00:00
|
|
|
|
2015-10-29 13:34:24 +00:00
|
|
|
{{ define "pagerduty.default.description" }}{{ template "__subject" . }}{{ end }}
|
2015-11-25 14:49:26 +00:00
|
|
|
{{ define "pagerduty.default.client" }}{{ template "__alertmanager" . }}{{ end }}
|
|
|
|
{{ define "pagerduty.default.clientURL" }}{{ template "__alertmanagerURL" . }}{{ end }}
|
2015-11-26 17:19:46 +00:00
|
|
|
{{ define "pagerduty.default.instances" }}{{ template "__text_alert_list" . }}{{ end }}
|
2015-10-29 13:34:24 +00:00
|
|
|
|
2015-10-11 11:32:34 +00:00
|
|
|
|
2016-07-12 12:36:20 +00:00
|
|
|
{{ define "opsgenie.default.message" }}{{ template "__subject" . }}{{ end }}
|
|
|
|
{{ define "opsgenie.default.description" }}{{ .CommonAnnotations.SortedPairs.Values | join " " }}
|
|
|
|
{{ if gt (len .Alerts.Firing) 0 -}}
|
|
|
|
Alerts Firing:
|
|
|
|
{{ template "__text_alert_list" .Alerts.Firing }}
|
|
|
|
{{- end }}
|
|
|
|
{{ if gt (len .Alerts.Resolved) 0 -}}
|
|
|
|
Alerts Resolved:
|
|
|
|
{{ template "__text_alert_list" .Alerts.Resolved }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
2015-11-26 17:19:46 +00:00
|
|
|
{{ define "opsgenie.default.source" }}{{ template "__alertmanagerURL" . }}{{ end }}
|
2015-11-24 22:29:25 +00:00
|
|
|
|
2015-11-26 17:19:46 +00:00
|
|
|
|
2017-12-09 15:20:22 +00:00
|
|
|
{{ define "wechat.default.message" }}{{ template "__subject" . }}
|
|
|
|
{{ .CommonAnnotations.SortedPairs.Values | join " " }}
|
|
|
|
{{ if gt (len .Alerts.Firing) 0 -}}
|
|
|
|
Alerts Firing:
|
|
|
|
{{ template "__text_alert_list" .Alerts.Firing }}
|
|
|
|
{{- end }}
|
|
|
|
{{ if gt (len .Alerts.Resolved) 0 -}}
|
|
|
|
Alerts Resolved:
|
|
|
|
{{ template "__text_alert_list" .Alerts.Resolved }}
|
|
|
|
{{- end }}
|
|
|
|
AlertmanagerUrl:
|
|
|
|
{{ template "__alertmanagerURL" . }}
|
|
|
|
{{- end }}
|
2018-06-24 12:02:21 +00:00
|
|
|
{{ define "wechat.default.to_user" }}{{ end }}
|
|
|
|
{{ define "wechat.default.to_party" }}{{ end }}
|
|
|
|
{{ define "wechat.default.to_tag" }}{{ end }}
|
|
|
|
{{ define "wechat.default.agent_id" }}{{ end }}
|
2017-12-09 15:20:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-03 09:44:53 +00:00
|
|
|
{{ define "victorops.default.state_message" }}{{ .CommonAnnotations.SortedPairs.Values | join " " }}
|
|
|
|
{{ if gt (len .Alerts.Firing) 0 -}}
|
|
|
|
Alerts Firing:
|
|
|
|
{{ template "__text_alert_list" .Alerts.Firing }}
|
|
|
|
{{- end }}
|
|
|
|
{{ if gt (len .Alerts.Resolved) 0 -}}
|
|
|
|
Alerts Resolved:
|
|
|
|
{{ template "__text_alert_list" .Alerts.Resolved }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{ define "victorops.default.entity_display_name" }}{{ template "__subject" . }}{{ end }}
|
2017-03-24 14:06:39 +00:00
|
|
|
{{ define "victorops.default.monitoring_tool" }}{{ template "__alertmanager" . }}{{ end }}
|
2016-07-03 15:33:44 +00:00
|
|
|
|
2016-02-26 08:35:00 +00:00
|
|
|
{{ define "pushover.default.title" }}{{ template "__subject" . }}{{ end }}
|
|
|
|
{{ define "pushover.default.message" }}{{ .CommonAnnotations.SortedPairs.Values | join " " }}
|
2016-04-27 08:46:17 +00:00
|
|
|
{{ if gt (len .Alerts.Firing) 0 }}
|
|
|
|
Alerts Firing:
|
|
|
|
{{ template "__text_alert_list" .Alerts.Firing }}
|
|
|
|
{{ end }}
|
|
|
|
{{ if gt (len .Alerts.Resolved) 0 }}
|
|
|
|
Alerts Resolved:
|
|
|
|
{{ template "__text_alert_list" .Alerts.Resolved }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
2016-02-26 08:35:00 +00:00
|
|
|
{{ define "pushover.default.url" }}{{ template "__alertmanagerURL" . }}{{ end }}
|
2021-06-10 02:13:26 +00:00
|
|
|
|
2021-06-15 22:24:52 +00:00
|
|
|
{{ define "sns.default.subject" }}{{ template "__subject" . }}{{ end }}
|
2021-06-10 02:13:26 +00:00
|
|
|
{{ define "sns.default.message" }}{{ .CommonAnnotations.SortedPairs.Values | join " " }}
|
|
|
|
{{ if gt (len .Alerts.Firing) 0 }}
|
|
|
|
Alerts Firing:
|
|
|
|
{{ template "__text_alert_list" .Alerts.Firing }}
|
|
|
|
{{ end }}
|
|
|
|
{{ if gt (len .Alerts.Resolved) 0 }}
|
|
|
|
Alerts Resolved:
|
|
|
|
{{ template "__text_alert_list" .Alerts.Resolved }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
2022-02-22 16:51:02 +00:00
|
|
|
|
|
|
|
{{ define "telegram.default.message" }}
|
|
|
|
{{ if gt (len .Alerts.Firing) 0 }}
|
|
|
|
Alerts Firing:
|
|
|
|
{{ template "__text_alert_list" .Alerts.Firing }}
|
|
|
|
{{ end }}
|
|
|
|
{{ if gt (len .Alerts.Resolved) 0 }}
|
|
|
|
Alerts Resolved:
|
|
|
|
{{ template "__text_alert_list" .Alerts.Resolved }}
|
|
|
|
{{ end }}
|
2022-06-10 14:17:14 +00:00
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ define "discord.default.title" }}{{ template "__subject" . }}{{ end }}
|
|
|
|
{{ define "discord.default.message" }}
|
|
|
|
{{ if gt (len .Alerts.Firing) 0 }}
|
|
|
|
Alerts Firing:
|
|
|
|
{{ template "__text_alert_list" .Alerts.Firing }}
|
|
|
|
{{ end }}
|
|
|
|
{{ if gt (len .Alerts.Resolved) 0 }}
|
|
|
|
Alerts Resolved:
|
|
|
|
{{ template "__text_alert_list" .Alerts.Resolved }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
2022-11-08 12:54:38 +00:00
|
|
|
|
|
|
|
{{ define "webex.default.message" }}{{ .CommonAnnotations.SortedPairs.Values | join " " }}
|
|
|
|
{{ if gt (len .Alerts.Firing) 0 }}
|
|
|
|
Alerts Firing:
|
|
|
|
{{ template "__text_alert_list" .Alerts.Firing }}
|
|
|
|
{{ end }}
|
|
|
|
{{ if gt (len .Alerts.Resolved) 0 }}
|
|
|
|
Alerts Resolved:
|
|
|
|
{{ template "__text_alert_list" .Alerts.Resolved }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
2023-06-08 15:27:56 +00:00
|
|
|
|
|
|
|
{{ define "msteams.default.title" }}{{ template "__subject" . }}{{ end }}
|
|
|
|
{{ define "msteams.default.text" }}
|
|
|
|
{{ if gt (len .Alerts.Firing) 0 }}
|
|
|
|
# Alerts Firing:
|
|
|
|
{{ template "__text_alert_list_markdown" .Alerts.Firing }}
|
|
|
|
{{ end }}
|
|
|
|
{{ if gt (len .Alerts.Resolved) 0 }}
|
|
|
|
# Alerts Resolved:
|
|
|
|
{{ template "__text_alert_list_markdown" .Alerts.Resolved }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|