added default alerts for nodes
This commit is contained in:
parent
2c33fcc9cf
commit
7997ebfb59
3 changed files with 208 additions and 2 deletions
10
templates/node-alerts.j2
Normal file
10
templates/node-alerts.j2
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
groups:
|
||||
{% for groupname, alerts in prometheus_agent.alerts|dict2items|groupby("value.group") %}
|
||||
- name: "{{inventory_hostname}}: {{ groupname }}"
|
||||
rules:
|
||||
{% for alertdict in alerts if alertdict.value.enabled %}
|
||||
- alert: {{ alertdict.value.alert|d(alertdict.key) }}
|
||||
{% set alert=alertdict.value|dict2items|rejectattr('key', 'in', ["enabled", "group", "alert"])|list|items2dict %}
|
||||
{{ alert|to_nice_yaml(indent=2, width=9999)|indent(width=4, first=True) }}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue