Log fail2ban bans to mysql
copy files to suitable folder
setup database: ./pyFail2Sql.py --setupdb
edit your action, for example action.d/iptables.conf
add row beneath 'actionban = iptables -I fail2ban- 1 -s -j '
add this: /path/to/your/folder/pyFail2Sql.py -w -n -q -p -i -e ban