solve repetitive alarms issue
This commit is contained in:
parent
8736df40b0
commit
48004f43e2
|
@ -706,24 +706,22 @@ def update_state_from_dictionaries(current_warnings, current_alarms, node_number
|
||||||
else:
|
else:
|
||||||
changed_alarms = {}
|
changed_alarms = {}
|
||||||
changed_warnings = {}
|
changed_warnings = {}
|
||||||
# calculate the diff in warnings and alarms
|
|
||||||
prev_alarm_value_list=list(previous_alarms.values())
|
|
||||||
alarm_keys=list(previous_alarms.keys())
|
|
||||||
|
|
||||||
for i, alarm in enumerate(current_alarms.values()):
|
for key in current_alarms:
|
||||||
if alarm!=prev_alarm_value_list[i]:
|
current_value = current_alarms[key]
|
||||||
changed_alarms[alarm_keys[i]]=True
|
prev_value = previous_alarms.get(key, False) # Use False if the key doesn't exist
|
||||||
|
if current_value != prev_value:
|
||||||
|
changed_alarms[key] = True
|
||||||
else:
|
else:
|
||||||
changed_alarms[alarm_keys[i]]=False
|
changed_alarms[key] = False
|
||||||
|
|
||||||
prev_warning_value_list=list(previous_warnings.values())
|
for key in current_warnings:
|
||||||
warning_keys=list(previous_warnings.keys())
|
current_value = current_warnings[key]
|
||||||
|
prev_value = previous_warnings.get(key, False)
|
||||||
for i, warning in enumerate(current_warnings.values()):
|
if current_value != prev_value:
|
||||||
if warning!=prev_warning_value_list[i]:
|
changed_warnings[key] = True
|
||||||
changed_warnings[warning_keys[i]]=True
|
|
||||||
else:
|
else:
|
||||||
changed_warnings[warning_keys[i]]=False
|
changed_warnings[key] = False
|
||||||
|
|
||||||
status_message = {
|
status_message = {
|
||||||
"InstallationId": INSTALLATION_ID,
|
"InstallationId": INSTALLATION_ID,
|
||||||
|
|
|
@ -159,24 +159,22 @@ def update_state_from_dictionaries(current_warnings, current_alarms, node_number
|
||||||
else:
|
else:
|
||||||
changed_alarms = {}
|
changed_alarms = {}
|
||||||
changed_warnings = {}
|
changed_warnings = {}
|
||||||
# calculate the diff in warnings and alarms
|
|
||||||
prev_alarm_value_list = list(previous_alarms.values())
|
|
||||||
alarm_keys = list(previous_alarms.keys())
|
|
||||||
|
|
||||||
for i, alarm in enumerate(current_alarms.values()):
|
for key in current_alarms:
|
||||||
if alarm != prev_alarm_value_list[i]:
|
current_value = current_alarms[key]
|
||||||
changed_alarms[alarm_keys[i]] = True
|
prev_value = previous_alarms.get(key, False) # Use False if the key doesn't exist
|
||||||
|
if current_value != prev_value:
|
||||||
|
changed_alarms[key] = True
|
||||||
else:
|
else:
|
||||||
changed_alarms[alarm_keys[i]] = False
|
changed_alarms[key] = False
|
||||||
|
|
||||||
prev_warning_value_list=list(previous_warnings.values())
|
for key in current_warnings:
|
||||||
warning_keys=list(previous_warnings.keys())
|
current_value = current_warnings[key]
|
||||||
|
prev_value = previous_warnings.get(key, False)
|
||||||
for i, warning in enumerate(current_warnings.values()):
|
if current_value != prev_value:
|
||||||
if warning!=prev_warning_value_list[i]:
|
changed_warnings[key] = True
|
||||||
changed_warnings[warning_keys[i]]=True
|
|
||||||
else:
|
else:
|
||||||
changed_warnings[warning_keys[i]]=False
|
changed_warnings[key] = False
|
||||||
|
|
||||||
status_message = {
|
status_message = {
|
||||||
"InstallationId": INSTALLATION_ID,
|
"InstallationId": INSTALLATION_ID,
|
||||||
|
|
Loading…
Reference in New Issue