From fa700982296ec685bd2e1c87e669d0b03cc357b7 Mon Sep 17 00:00:00 2001 From: Patrick Toal Date: Wed, 17 Apr 2024 14:12:26 -0400 Subject: [PATCH] Fix paths to vars --- playbooks/investigate_high_cpu.yml | 6 +++--- templates/cpuhog_ticket.j2 | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/playbooks/investigate_high_cpu.yml b/playbooks/investigate_high_cpu.yml index d3d0886..85afb51 100644 --- a/playbooks/investigate_high_cpu.yml +++ b/playbooks/investigate_high_cpu.yml @@ -23,9 +23,9 @@ servicenow.itsm.incident: state: new caller: "admin" - short_description: "CPUHog event detected on: {{ event.alert.labels.instance }}" - description: "A CPUHog was detected on: {{ event.alert.labels.instance }} that needs to be investigated." + short_description: "CPUHog event detected on: {{ ansible_eda.event.alert.labels.instance }}" + description: "A CPUHog was detected on: {{ ansible_eda.event.alert.labels.instance }} that needs to be investigated." impact: high urgency: high delegate_to: localhost - \ No newline at end of file + \ No newline at end of file diff --git a/templates/cpuhog_ticket.j2 b/templates/cpuhog_ticket.j2 index 4f9ed2e..76db257 100644 --- a/templates/cpuhog_ticket.j2 +++ b/templates/cpuhog_ticket.j2 @@ -1,11 +1,11 @@ = CPUHog Report = A high CPU event was triggered from AlertManager. -{% if event is defined %} -Annotations: "{{ event.alert.annotations }}" -Generator URL: "{{ event.alert.generatorURL }}" -Severity: "{{ event.alert.labels.severity }}" -Instance: "{{ event.alert.labels.instance }}" +{% if ansible_eda is defined %} +Annotations: "{{ ansible_eda.event.alert.annotations }}" +Generator URL: "{{ ansible_eda.event.alert.generatorURL }}" +Severity: "{{ ansible_eda.event.alert.labels.severity }}" +Instance: "{{ ansible_eda.event.alert.labels.instance }}" {% endif %} ** Top CPU Consumers **