Commit fbd6fb8e authored by Dmitry Volodin's avatar Dmitry Volodin
Browse files

Merge branch 'noc-1776' into 'master'

noc/noc#1776 Add watch_escalation to check consequence policy.

See merge request noc/noc!6037
parents 91ea6d1b 501ee227
......@@ -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,11 @@ 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
# @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
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment