add filter check to alarm

add filter.checkFilters() to alarmHandler.processAlarm()
This commit is contained in:
Bastian Schroll 2015-05-23 09:34:48 +02:00
parent 206463f8e9
commit 02a84b6ec9
2 changed files with 11 additions and 4 deletions

View file

@ -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]")

View file

@ -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: