diff --git a/includes/alarmHandler.py b/includes/alarmHandler.py index 8890ee4..6c648cf 100644 --- a/includes/alarmHandler.py +++ b/includes/alarmHandler.py @@ -7,8 +7,10 @@ from includes import globals # Global variables def processAlarm(typ,freq,data): logging.debug("[ ALARM ]") - for name, plugin in globals.pluginList.items(): - logging.debug("call Plugin: %s", name) - plugin.run(typ,freq,data) - logging.debug("return from: %s", name) + for pluginName, plugin in globals.pluginList.items(): + from includes import filter + if filter.checkFilters(data,typ,pluginName): + logging.debug("call Plugin: %s", pluginName) + plugin.run(typ,freq,data) + logging.debug("return from: %s", pluginName) logging.debug("[END ALARM]") \ No newline at end of file diff --git a/includes/filter.py b/includes/filter.py index 03beced..6de5d44 100644 --- a/includes/filter.py +++ b/includes/filter.py @@ -23,6 +23,11 @@ def checkFilters(data,typ,plugin): try: logging.debug("search Filter for %s to %s", typ, plugin) + #extract the correct data for filtering + if typ == "FMS": data = data["fms"] + if typ == "ZVEI": data = data["zvei"] + if typ == "POC": data = data["poc"] + foundFilter = False for i in globals.filterList: if i["typ"] == typ and i["plugin"] == plugin: