Merge "LN0739_FM_FR12: support for options to dynamically create the AlarmDefinitions - provided options to dynamically configure the AlarmDefinitions - alarm manager to suppress the alarms if specific problem is unknown to it (already existign functionality with static AlarmDefinitions ). - provided CLI interface to define alarm definitions - provided GET and DELETE interface for alarm definitions - corrected the run.sh script - corrections for build failure"
diff --git a/manager/cmd/manager.go b/manager/cmd/manager.go
index 397cd3e..8b4ac74 100755
--- a/manager/cmd/manager.go
+++ b/manager/cmd/manager.go
@@ -82,11 +82,18 @@
// Suppress duplicate alarms
idx, found := a.IsMatchFound(m.Alarm)
- if found && m.AlarmAction != alarm.AlarmActionClear {
+ if found && m.AlarmAction == alarm.AlarmActionRaise {
app.Logger.Info("Duplicate alarm found, suppressing ...")
- return nil, nil
+ if m.PerceivedSeverity == a.activeAlarms[idx].PerceivedSeverity {
+ // Duplicate with same severity found
+ return nil, nil
+ } else {
+ // Remove duplicate with different severity
+ a.activeAlarms = a.RemoveAlarm(a.activeAlarms, idx, "active")
+ }
}
+
// Clear alarm if found from active alarm list
if m.AlarmAction == alarm.AlarmActionClear {
if found {