Fail2ban Status commands

fail2ban-client status postfix

Show status of all fail2ban jails at once
create the file fail2ban-allstatus.sh
#!/bin/bash
JAILS=`fail2ban-client status | grep Jail list | sed -E s/^[^:]+:[ \t]+// | sed s/,//g`
for JAIL in $JAILS
do
fail2ban-client status $JAIL
done

or with a command

fail2ban-client status|awk -F: ‘/Jail list:/ { split($2,jail,”,”) ; for (i in jail) { gsub(/[\t ]/,””,jail[i]); system(“fail2ban-client status “jail[i]); }; }’

grep -srni “journalmatch” /etc/fail2ban/filter.d/

 

Leave a Reply