From 58ad0e5308a995fb5ebced9c79691ed4523b292b Mon Sep 17 00:00:00 2001 From: f-kessler Date: Fri, 10 Aug 2018 23:12:42 +0200 Subject: [PATCH 1/6] Clear buffer after multicastAlarm_ric received Fix for networks that mix normal alarms with multicastAlarms (delimiter needs to be deactivated). If the delimiter is deactivated, RICs in the buffer will be deleted only if they are older than multicastAlarm_ignore_time. This could cause a mixture of RICs of the current and the privious multicastAlarm. This problem can be fixed, by clearing the buffer after the multicastAlarm sequence has finished. --- includes/multicastAlarm.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/multicastAlarm.py b/includes/multicastAlarm.py index 40a8344..b6d1e7d 100644 --- a/includes/multicastAlarm.py +++ b/includes/multicastAlarm.py @@ -58,6 +58,8 @@ def multicastAlarmExec(freq, data): try: from includes import alarmHandler alarmHandler.processAlarmHandler("POC", freq, data) + multiList = [] + logging.debug("multicastAlarm finished - buffer cleared") except: logging.error("processing alarm failed") logging.debug("processing alarm failed", exc_info=True) From 86c0467ee23b05982171f58333d2739d3dd63a2b Mon Sep 17 00:00:00 2001 From: f-kessler Date: Fri, 10 Aug 2018 23:19:08 +0200 Subject: [PATCH 2/6] Updated description for the multicastAlarm_delimiter_ric --- config/config.template.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.template.ini b/config/config.template.ini index d17cd3f..11a6caf 100644 --- a/config/config.template.ini +++ b/config/config.template.ini @@ -144,7 +144,7 @@ multicastAlarm = 0 # time limit for alarms that do not belong to the multicastAlarm sequence in seconds multicastAlarm_ignore_time = 15 -# multicastAlarm delimiter RIC (usually used as a starting point for a alarm sequence) (can be empty) +# multicastAlarm delimiter RIC (usually used as a starting point for a alarm sequence). Needs to be empty if multicastAlarms are interrupted by normal alarms. multicastAlarm_delimiter_ric = # multicastAlarm RIC that is used to send the text message From 8c1351ccbd467f2b6bb2ef44b45687021dbc054d Mon Sep 17 00:00:00 2001 From: f-kessler Date: Sat, 11 Aug 2018 12:52:30 +0200 Subject: [PATCH 3/6] fixed the delete of all contents in multiList --- includes/multicastAlarm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/multicastAlarm.py b/includes/multicastAlarm.py index b6d1e7d..e9b8122 100644 --- a/includes/multicastAlarm.py +++ b/includes/multicastAlarm.py @@ -29,7 +29,7 @@ def newEntrymultiList(data): timestamp = int(time.time()) # multicastAlarm processing if enabled and delimiter RIC has been received if data['ric'] == globalVars.config.get("multicastAlarm", "multicastAlarm_delimiter_ric"): - multiList = [] + del multiList[:] logging.debug("delimiter RIC received - buffer cleared") else: multiList.append([data, timestamp]) @@ -58,7 +58,7 @@ def multicastAlarmExec(freq, data): try: from includes import alarmHandler alarmHandler.processAlarmHandler("POC", freq, data) - multiList = [] + del multiList[:] logging.debug("multicastAlarm finished - buffer cleared") except: logging.error("processing alarm failed") From ce144c82e19fa3517971cc94ba27f4d2a5c54703 Mon Sep 17 00:00:00 2001 From: f-kessler Date: Sat, 11 Aug 2018 13:37:30 +0200 Subject: [PATCH 4/6] moved delete to the end of the function --- includes/multicastAlarm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/multicastAlarm.py b/includes/multicastAlarm.py index e9b8122..d8736fd 100644 --- a/includes/multicastAlarm.py +++ b/includes/multicastAlarm.py @@ -58,8 +58,8 @@ def multicastAlarmExec(freq, data): try: from includes import alarmHandler alarmHandler.processAlarmHandler("POC", freq, data) - del multiList[:] - logging.debug("multicastAlarm finished - buffer cleared") except: logging.error("processing alarm failed") logging.debug("processing alarm failed", exc_info=True) + del multiList[:] + logging.debug("multicastAlarm finished - buffer cleared") From e5db9fed097970c1a3492dfb005e5842f661ec6e Mon Sep 17 00:00:00 2001 From: f-kessler Date: Sat, 11 Aug 2018 16:43:38 +0200 Subject: [PATCH 5/6] fixed indenting bug --- includes/multicastAlarm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/multicastAlarm.py b/includes/multicastAlarm.py index d8736fd..8aafadd 100644 --- a/includes/multicastAlarm.py +++ b/includes/multicastAlarm.py @@ -61,5 +61,5 @@ def multicastAlarmExec(freq, data): except: logging.error("processing alarm failed") logging.debug("processing alarm failed", exc_info=True) - del multiList[:] - logging.debug("multicastAlarm finished - buffer cleared") + del multiList[:] + logging.debug("multicastAlarm finished - buffer cleared") From cf7e8ead5afbbdf4eed296e0e36e3591a58855c5 Mon Sep 17 00:00:00 2001 From: f-kessler Date: Thu, 16 Aug 2018 10:58:10 +0200 Subject: [PATCH 6/6] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a5e25e..e9475dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ ##### Changed - multicastAlarm Plugin - RICs die von multicastAlarm genutzt werden, müssen nicht mehr in der config bei allow_ric bzw. filter_range_start/filter_range_end berücksichtigt werden. [#357](https://github.com/Schrolli91/BOSWatch/pull/357) - FFAgent Plugin - Debug Logging für die alarmHeaders eingebaut zwecks Troubleshooting [#354](https://github.com/Schrolli91/BOSWatch/pull/354) +- multicastAlarm Plugin - Buffer nach jedem Alarm löschen - erlaubt in kombination mit "doubleFilter_check_msg" die Verwendung in Netzen, die zwischen multicastAlarm RICs auch normale Alarme senden. #370(https://github.com/Schrolli91/BOSWatch/pull/370) ##### Deprecated ##### Removed ##### Fixed