Support for the banip command is the new addBannedIP method of the Filter class in server/filter.py. This method sets unixTime = time.time() without importing time. It should probably set unixTime = MyTime.time() instead.
I made the suggested change above, replacing unixTime = time.time() with unixTime = MyTime.time(), and now the command
fail2ban-client set <JAIL> banip <IP>
is accepted and instead of responding "global name 'time' is not defined" as before, it responds with the IP, but the IP is not banned.
banip does not work for me in CentOS 5.x (and presumably RHEL5.x). I have updated python to latest, 2.4.3-44. I have tried fail2ban 0.8.4 through 0.8.6, using rpm, tar, github versions. I manually changed filter.py to import the time module in 0.8.4. No errors at all reported, but no IP gets banned using banip. Filters do work, so automatic banning does work.
Log in to post a comment.