feat(alertmanager_receiver): add role
This commit is contained in:
51
roles/alertmanager_receiver/defaults/main/templates.yml
Normal file
51
roles/alertmanager_receiver/defaults/main/templates.yml
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
alertmanager_receiver_config_templating_computed_values_default:
|
||||
- values: # always set 'color' to 'yellow'
|
||||
color: yellow
|
||||
- values: # set 'color' to 'orange' when alert label 'severity' is 'warning'
|
||||
color: orange
|
||||
when-matching-labels:
|
||||
severity: warning
|
||||
- values: # set 'color' to 'red' when alert label 'severity' is 'critical'
|
||||
color: red
|
||||
when-matching-labels:
|
||||
severity: critical
|
||||
- values: # set 'color' to 'green' when alert status is 'resolved'
|
||||
color: green
|
||||
when-matching-status: resolved
|
||||
|
||||
alertmanager_receiver_config_templating_firing_template_default: |+2
|
||||
{% raw -%}
|
||||
<p>
|
||||
<strong><font color="{{ .ComputedValues.color }}">{{ .Alert.Status | ToUpper }}</font></strong>
|
||||
{{ if .Alert.Labels.name }}
|
||||
{{ .Alert.Labels.name }}
|
||||
{{ else if .Alert.Labels.alertname }}
|
||||
{{ .Alert.Labels.alertname }}
|
||||
{{ end }}
|
||||
>>
|
||||
{{ if .Alert.Labels.severity }}
|
||||
{{ .Alert.Labels.severity | ToUpper }}:
|
||||
{{ end }}
|
||||
{{ if .Alert.Annotations.description }}
|
||||
{{ .Alert.Annotations.description }}
|
||||
{{ else if .Alert.Annotations.summary }}
|
||||
{{ .Alert.Annotations.summary }}
|
||||
{{ end }}
|
||||
>>
|
||||
{{ if .Alert.Annotations.runbook }}
|
||||
<a href="{{ .Alert.Annotations.runbook }}">Runbook</a> |
|
||||
{{ end }}
|
||||
{{ if .Alert.Annotations.dashboard }}
|
||||
<a href="{{ .Alert.Annotations.dashboard }}">Dashboard</a> |
|
||||
{{ end }}
|
||||
<a href="{{ .SilenceURL }}">Silence</a>
|
||||
</p>
|
||||
{%- endraw %}
|
||||
|
||||
alertmanager_receiver_config_templating_resolved_template_default: |+2
|
||||
{% raw -%}
|
||||
<strong>
|
||||
<font color="{{ .ComputedValues.color }}">{{ .Alert.Status | ToUpper }}</font>
|
||||
</strong>{{ .Alert.Labels.name }}
|
||||
{%- endraw %}
|
Reference in New Issue
Block a user