From 9e7298478d9f73ce1d102cec46d0533a6319d837 Mon Sep 17 00:00:00 2001 From: Stefan Reimer Date: Thu, 24 Feb 2022 12:34:12 +0100 Subject: [PATCH] fix: only overwrite severity for alarm being raised not cleared --- app.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 3a66cb9..3513184 100644 --- a/app.py +++ b/app.py @@ -125,8 +125,9 @@ def handler(event, context): msg_type = notify_map[msg["NewStateValue"].lower()] # Reduce severtity for CPUCredit Alarms to Warning - if msg["Trigger"]["MetricName"] == "CPUSurplusCreditBalance": - msg_type = apprise.NotifyType.WARNING + if msg_type == apprise.NotifyType.FAILURE: + if msg["Trigger"]["MetricName"] == "CPUSurplusCreditBalance": + msg_type = apprise.NotifyType.WARNING except KeyError: pass