From ebca928ebdeff8da911e2f6a45fcc184a559e141 Mon Sep 17 00:00:00 2001 From: Andrey Vertiprahov Date: Sat, 22 Jan 2022 00:04:44 +0500 Subject: [PATCH 1/2] Add watch_escalation to check consequence policy. --- services/correlator/check.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/services/correlator/check.py b/services/correlator/check.py index a7ac8c679a..d0ac4187ca 100644 --- a/services/correlator/check.py +++ b/services/correlator/check.py @@ -10,6 +10,7 @@ import logging # NOC modules from noc.fm.models.utils import get_alarm +from noc.fm.models.alarmescalation import AlarmEscalation from noc.core.perf import metrics logger = logging.getLogger(__name__) @@ -29,3 +30,10 @@ def check_close_consequence(alarm_id): alarm.root = None alarm.log_message("Detached from root for not recovered", to_save=True) metrics["detached_root"] += 1 + # Trigger escalations + if alarm.managed_object.tt_system.alarm_consequence_policy == "D": + return + # Do not remove, if escalation is not performed escalation doc not created + AlarmEscalation.watch_escalations( + alarm, timestamp_policy=alarm.managed_object.tt_system.alarm_consequence_policy + ) -- GitLab From 394db19623233fe1fc1ee717e251327554dd9fc6 Mon Sep 17 00:00:00 2001 From: Andrey Vertiprahov Date: Sat, 22 Jan 2022 00:09:23 +0500 Subject: [PATCH 2/2] Add todo. --- services/correlator/check.py | 1 + 1 file changed, 1 insertion(+) diff --git a/services/correlator/check.py b/services/correlator/check.py index d0ac4187ca..59b6092426 100644 --- a/services/correlator/check.py +++ b/services/correlator/check.py @@ -33,6 +33,7 @@ def check_close_consequence(alarm_id): # Trigger escalations if alarm.managed_object.tt_system.alarm_consequence_policy == "D": return + # @todo check if root is not escalated # Do not remove, if escalation is not performed escalation doc not created AlarmEscalation.watch_escalations( alarm, timestamp_policy=alarm.managed_object.tt_system.alarm_consequence_policy -- GitLab