Just another IT site ※IT系の記事は当方環境での実施内容となるため実施する場合は自己責任でお願いいたします。At Your Own Risk!! TURN BACK WHILE YOU CAN
PR

fail2banで設定しているjailのstatusをすべて表示する

※IT系の記事は当方環境での実施内容となるため実施する場合は自己責任でお願いいたします。スクリプトはAI生成のものも多いのでコピー&ペーストの際は文字コードに注意ください!

これはなかなか便利

Show status of all fail2ban jails at once
Show status of all fail2ban jails at once. GitHub Gist: instantly share code, notes, and snippets.
fail2ban-client status | sed -n 's/,//g;s/.*Jail list://p' | xargs -n1 fail2ban-client status

Nice. Needs sudo, so

sudo sh -c "fail2ban-client status | sed -n 's/,//g;s/.*Jail list://p' | xargs -n1 fail2ban-client status"

watchコマンドでモニターしたければ

watch "fail2ban-client status | sed -n 's/,//g;s/.*Jail list://p' | xargs -n1 fail2ban-client status"

もしくはシェルスクリプトとして記述して

watch fail2ban_allstatus.sh

とか

タイトルとURLをコピーしました