Working alertmanager source. Starting playbook to clean logfiles

This commit is contained in:
2024-01-18 07:59:42 -05:00
parent 7b5eac7ad1
commit 7056507aa9
2 changed files with 41 additions and 12 deletions

View File

@@ -10,15 +10,21 @@
- name: Run Template
condition:
all:
- event.alert.labels.org == "OYS"
- event.alert.labels.alertname == "root filesystem over 80% full"
- event.alert.labels.mountpoint == '/'
action:
run_job_template:
name: Demo - Clean Log Directory
organization: OYS
job_args:
extra_vars:
alertmanager_annotations: "{{ event.annotations }}"
alertmanager_generator_url: "{{ event.generatorURL }}"
event_mountpoint: "{{ event.mountpoint }}"
- event.alert.labels.org == "OYS" and event.alert.status == "firing" and event.alert.labels.alertname == "root filesystem over 80% full"
actions:
- print_event:
pretty: true
- run_job_template:
name: Demo - Clean Log Directory
organization: OYS
job_args:
extra_vars:
alertmanager_annotations: "{{ event.alert.annotations }}"
alertmanager_generator_url: "{{ event.alert.generatorURL }}"
event_mountpoint: "{{ event.alert.labels.mountpoint }}"
alertmanager_instance: "{{ event.alert.labels.instance }}"
- name: Test Contact Point
condition: event.alert.labels.alertname == "TestAlert" or event.alert.labels.org == "OYS"
actions:
- print_event:
pretty: true