mirror of https://github.com/fail2ban/fail2ban
ENH: FailManager -- improve log message to report total # of detected failures as well
parent
f72bc13111
commit
c29553354b
|
@ -106,15 +106,16 @@ class FailManager:
|
||||||
fData.setLastTime(unixTime)
|
fData.setLastTime(unixTime)
|
||||||
self.__failList[ip] = fData
|
self.__failList[ip] = fData
|
||||||
|
|
||||||
|
self.__failTotal += 1
|
||||||
|
|
||||||
if logSys.getEffectiveLevel() <= logging.DEBUG:
|
if logSys.getEffectiveLevel() <= logging.DEBUG:
|
||||||
# yoh: Since composing this list might be somewhat time consuming
|
# yoh: Since composing this list might be somewhat time consuming
|
||||||
# in case of having many active failures, it should be ran only
|
# in case of having many active failures, it should be ran only
|
||||||
# if debug level is "low" enough
|
# if debug level is "low" enough
|
||||||
failures_summary = ', '.join(['%s:%d' % (k, v.getRetry())
|
failures_summary = ', '.join(['%s:%d' % (k, v.getRetry())
|
||||||
for k,v in self.__failList.iteritems()])
|
for k,v in self.__failList.iteritems()])
|
||||||
logSys.debug("Currently have failures from %d IPs (IP:count): %s"
|
logSys.debug("Total # of detected failures: %d. Current failures from %d IPs (IP:count): %s"
|
||||||
% (len(self.__failList), failures_summary))
|
% (self.__failTotal, len(self.__failList), failures_summary))
|
||||||
self.__failTotal += 1
|
|
||||||
finally:
|
finally:
|
||||||
self.__lock.release()
|
self.__lock.release()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue