Skip to content

Instantly share code, notes, and snippets.

@welrbraga
Created December 8, 2017 10:21
Show Gist options
  • Save welrbraga/4492237f9cf705b921be4c44c68ceb50 to your computer and use it in GitHub Desktop.
Save welrbraga/4492237f9cf705b921be4c44c68ceb50 to your computer and use it in GitHub Desktop.
faill2ban status all
#!/bin/bash
#Save this script on /usr/local/bin
#welrbraga - 2017-12-07
fail2ban-client status|awk -F: '/Jail list:/ { split($2,jail,",") ; for (i in jail) { gsub(/[\t ]/,"",jail[i]); system("fail2ban-client status "jail[i]); }; }'
@welrbraga
Copy link
Author

Fail2ban has no way to show individual status for each jail. So, in this git I use awk to get all jails and show their status.

Save it in file on /usr/local/bin with executable permission and have fun.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment