Send critical alerts via email (in addition to XMPP)
This commit is contained in:
@@ -20,6 +20,7 @@ route:
|
||||
receivers:
|
||||
<% @receivers.each do |receiver| %>
|
||||
- name: <%= receiver["name"] %>
|
||||
<% if receiver["webhook_configs"] %>
|
||||
<% receiver["webhook_configs"].each do |wc| %>
|
||||
webhook_configs:
|
||||
- url: "<%= @webhook_url %>"
|
||||
@@ -29,3 +30,15 @@ receivers:
|
||||
message: '{{ if eq .Status "resolved" }}✅{{ else if eq .CommonLabels.severity "warning" }}⚠️{{ else if eq .CommonLabels.severity "critical" }}🚨{{ end }} {{ .Status | toUpper }}: {{ .CommonLabels.alertname }}{{ if .CommonLabels.instance }} on {{ .CommonLabels.instance }}{{ end }}{{ if .CommonLabels.vm_host }} (host: {{ .CommonLabels.vm_host }}){{ end }} — {{ .CommonAnnotations.summary }}'
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if receiver["email_configs"] %>
|
||||
<% receiver["email_configs"].each do |ec| %>
|
||||
email_configs:
|
||||
- to: "<%= ec["to"] %>"
|
||||
from: "<%= ec["from"] %>"
|
||||
smarthost: "<%= ec["smarthost"] %>"
|
||||
require_tls: <%= ec["require_tls"] %>
|
||||
send_resolved: <%= ec["send_resolved"] %>
|
||||
text: '{{ .Status | toUpper }}: {{ .CommonLabels.alertname }}{{ if .CommonLabels.instance }} on {{ .CommonLabels.instance }}{{ end }}{{ if .CommonLabels.vm_host }} (host: {{ .CommonLabels.vm_host }}){{ end }} — {{ .CommonAnnotations.summary }}'
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user