diff --git a/fm/models/alarmescalation.py b/fm/models/alarmescalation.py index 762e98944796de9e735d4c77d7f9cdbdcc43a0f7..faf61635eb35aef1444f8705d66acb412a05e99c 100644 --- a/fm/models/alarmescalation.py +++ b/fm/models/alarmescalation.py @@ -65,6 +65,7 @@ class EscalationItem(EmbeddedDocument): clear_template = ForeignKeyField(Template) create_tt = BooleanField(default=False) promote_group_tt = BooleanField(default=True) + promote_affected_tt = BooleanField(default=True) close_tt = BooleanField(default=False) wait_tt = BooleanField(default=False) # Stop or continue to next rule diff --git a/services/escalator/escalation.py b/services/escalator/escalation.py index 63b179fa3f71c1b9d3abb05d010ec8d4774f6936..2da85e34e5d6e9baa57291358e4bf33816198e45 100644 --- a/services/escalator/escalation.py +++ b/services/escalator/escalation.py @@ -206,28 +206,33 @@ def escalate(alarm_id, escalation_id, escalation_delay, login="correlator", *arg log("Promoting to group tt") gtt = tts.create_group_tt(tt_id, alarm.timestamp) # Append affected objects - for ao in alarm.iter_affected(): - if ao.can_escalate(True): - if ao.tt_system == mo.tt_system: - log("Appending object %s to group tt %s", ao.name, gtt) - try: - tts.add_to_group_tt(gtt, ao.tt_system_id) - except TTError as e: - alarm.set_escalation_error( - "[%s] %s" % (mo.tt_system.name, e) + if tts.promote_affected_tt: + for ao in alarm.iter_affected(): + if ao.can_escalate(True): + if ao.tt_system == mo.tt_system: + log( + "Appending object %s to group tt %s", + ao.name, + gtt, + ) + try: + tts.add_to_group_tt(gtt, ao.tt_system_id) + except TTError as e: + alarm.set_escalation_error( + "[%s] %s" % (mo.tt_system.name, e) + ) + else: + log( + "Cannot append object %s to group tt %s: Belongs to other TT system", + ao.name, + gtt, ) else: log( - "Cannot append object %s to group tt %s: Belongs to other TT system", + "Cannot append object %s to group tt %s: Escalations are disabled", ao.name, gtt, ) - else: - log( - "Cannot append object %s to group tt %s: Escalations are disabled", - ao.name, - gtt, - ) metrics["escalation_tt_create"] += 1 except TTError as e: log("Failed to create TT: %s", e) diff --git a/ui/web/fm/alarmescalation/Application.js b/ui/web/fm/alarmescalation/Application.js index 95e9e5ba682926525ed04275953cb10972f37aef..abe16854165cc34e6c6fd2799903d2087209b9ff 100644 --- a/ui/web/fm/alarmescalation/Application.js +++ b/ui/web/fm/alarmescalation/Application.js @@ -165,6 +165,13 @@ Ext.define("NOC.fm.alarmescalation.Application", { width: 50, renderer: NOC.render.Bool }, + { + text: __("ATT"), + dataIndex: "promote_affected_tt", + editor: "checkboxfield", + width: 50, + renderer: NOC.render.Bool + }, { text: __("Wait TT"), dataIndex: "wait_tt",