[FIRING:1] warning@my_server high_storage_load
warning@my_server: Host storage usage is 81%.
[RESOLVED] high_storage_load@my_server
Resolved@my_server: Host storage usage is 81%.
# Pagerduty description
{{ define "PAGERDUTY_DESCRIPTION" }}
{{if .CommonAnnotations.summary }}{{ .CommonAnnotations.summary }}
{{ else }}{{ .GroupLabels.alertname }}
{{ if .CommonLabels.instance }}{{ .CommonLabels.instance }}
{{ end }}
{{ end }}
{{ end }}
################
# Runbook
################
# Runbook Search
{{ define "RUNBOOK_SEARCH" }}https://dsmith73.github.io/101-docs/search/?q={{ .CommonLabels.alertname }}{{ end }}
################
# Slack
################
# Slack Color
{{ define "SLACK_MSG_COLOR" }}{{ if eq .Status "firing" }}{{ if eq .CommonLabels.severity "critical" }}danger{{ else if eq .CommonLabels.severity "error" }}danger{{ else if eq .CommonLabels.severity "warning" }}warning{{ else }}#439FE0{{ end }}{{ else}}good{{ end }}{{ end }}
# Slack Text
{{define "SLACK_MSG_TEXT" }}
<!here> - {{ .CommonAnnotations.description }}
`View:` :chart_with_upwards_trend:*<{{ (index .Alerts 0).GeneratorURL }}|Prometheus>* or :notebook:*<{{ template "RUNBOOK_SEARCH" . }}|Runbook>*
*Details:*
{{ range .CommonLabels.SortedPairs }}• *{{ .Name }}:* `{{ .Value }}`
{{ end }}
{{ end }}
#Slack Summary
{{ define "SLACK_TITLE_SUMMARY" -}}
{{- if .CommonAnnotations.summary -}}
{{- .CommonAnnotations.summary -}}
{{- else -}}
{{- with index .Alerts 0 -}}
{{- .Annotations.summary -}}
{{- end -}}
{{- end -}}
{{- end -}}
# Slack Title
{{ define "SLACK_MSG_TITLE" }}
{{ if eq .Status "resolved" }}
{{- .Status | toUpper }} : {{ template "SLACK_TITLE_SUMMARY" . }}
{{ else if eq .Status "firing" }}
{{ .CommonLabels.severity | toUpper }} : {{ template "SLACK_TITLE_SUMMARY" . }}
{{ end }}
{{ end }}