diff --git a/includes/doubleFilter.py b/includes/doubleFilter.py index ae7872b..7c6b6cb 100644 --- a/includes/doubleFilter.py +++ b/includes/doubleFilter.py @@ -31,15 +31,20 @@ def checkID(typ, id, msg=""): """ timestamp = int(time.time()) # Get Timestamp + logging.debug("checkID: %s (%s)", id, msg) for i in range(len(globals.doubleList)): (xID, xTimestamp, xMsg) = globals.doubleList[i] # given ID found? # return False if the first entry in double_ignore_time is found, we will not check for younger ones... if id == xID and timestamp < xTimestamp + globals.config.getint("BOSWatch", "doubleFilter_ignore_time"): + logging.debug("-- previous id %s is within doubleFilter_ignore_time (%ss)", xID, globals.config.getint("BOSWatch", "doubleFilter_ignore_time")) # if wanted, we have to check the msg additional if "POC" in typ and globals.config.getint("BOSWatch", "doubleFilter_check_msg"): + logging.debug("-- compare msg:") + logging.debug("---- current msg: (%s)", msg.strip()) + logging.debug("---- previous msg: (%s)", xMsg) # if msg is a substring of xMsg we found a double - if msg in xMsg: + if msg.strip() in xMsg: logging.info("%s double alarm (id+msg): %s within %s second(s)", typ, xID, timestamp-xTimestamp) return False else: @@ -55,7 +60,7 @@ def newEntry(id, msg = ""): @return: nothing """ timestamp = int(time.time()) # Get Timestamp - globals.doubleList.append((id, timestamp, msg)) + globals.doubleList.append((id, timestamp, msg.strip())) logging.debug("Added %s to doubleList", id) diff --git a/includes/globals.py b/includes/globals.py index 68edb5c..a9b307d 100644 --- a/includes/globals.py +++ b/includes/globals.py @@ -10,7 +10,7 @@ Global variables # version info versionNr = "2.1-dev" -buildDate = "2015/07/28" +buildDate = "2015/07/29" # Global variables config = 0