CSF and BFM can be used together. Why do you need fail2ban? I doubt that is a good idea to have them all to do the same thing.
there is absolutly no reason to use fail2ban, with CSF, LFD and BruteForce monitor it works like a charm!
#!/bin/sh
/etc/csf/csf.pl -td $ip 86400 BFM IP Block
exit 0;
#!/bin/sh
SCRIPT=/usr/local/directadmin/scripts/custom/block_ip.sh
ip=$value $SCRIPT
exit $?;
You could also skip the complete iptables manual and just create a couple of scripts which makes csf do a tempban. In that case unbanning is not needed anymore.
if [ -x "/etc/csf/csf.pl" ]; then
echo "Found csf instaled, so blocking $ip with it<br>";
/etc/csf/csf.pl -d $ip
else
echo "Blocking $ip and restarting iptables ...<br>";
/etc/init.d/iptables restart