mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2026-01-24 09:00:23 +01:00
add filter.py
filtering alarms method getFilters() added
This commit is contained in:
parent
298ed0a06c
commit
43e56967cc
|
|
@ -24,6 +24,13 @@ poc_filter_range_start = 0000000
|
|||
poc_filter_range_end = 9999999
|
||||
|
||||
|
||||
[Filters]
|
||||
#NAME = TYP;PLUGIN;REGEX
|
||||
zvei_local_filter = ZVEI;template;25[0-9F]{3}
|
||||
zvei_mysql = ZVEI;MySQL;23[0-9F]{3}
|
||||
fms_filter = FMS;template;25[0-9F]{3}
|
||||
|
||||
|
||||
[Plugins]
|
||||
#can take on or off the plugins (0|1)
|
||||
MySQL = 0
|
||||
|
|
|
|||
17
includes/filter.py
Normal file
17
includes/filter.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: cp1252 -*-
|
||||
|
||||
import logging # Global logger
|
||||
|
||||
from includes import globals # Global variables
|
||||
|
||||
|
||||
def getFilters():
|
||||
logging.debug("reading config file")
|
||||
try:
|
||||
for key,val in globals.config.items("Filters"):
|
||||
logging.debug(" - %s = %s", key, val)
|
||||
filter = val.split(";")
|
||||
globals.filterList.append({"name": key, "typ": filter[0], "plugin": filter[1], "regex": filter[2]})
|
||||
except:
|
||||
logging.exception("cannot read config file")
|
||||
|
|
@ -15,5 +15,8 @@ zvei_time_old = 0
|
|||
poc_id_old = 0
|
||||
poc_time_old = 0
|
||||
|
||||
#pluginHandler
|
||||
pluginList = {}
|
||||
#pluginLoader
|
||||
pluginList = {}
|
||||
|
||||
#filter
|
||||
filterList = []
|
||||
Loading…
Reference in a new issue