
fail2banにイベントのアラートメールを送ってもらいたいです。設定ファイル全体にdest変数が散らばっているようです/etc/fail2ban
。/etc/fail2ban/action.d
すべてのイベントに 1 つの送信先メールを設定する方法はありますか? これに関する最新のドキュメントが見つからないようです。
jail.local には以下が含まれます:
# ban & send an e-mail with whois report to the destemail.
action_mw = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
%(mta)s-whois[name=%(__name__)s, dest="%(destemail)s", protocol="%(protocol)s", chain="%(chain)s"]
しかし、 はどこにdestemail
設定されているのでしょうか? が動作していることをすばやくテストする方法を知っておくことも役立ちますdestemail
。
答え1
/etc/fail2ban/jail.local
からコピーされた (centos 6.7 上)にあるようですjail.conf
。
メール配信が機能しているかをテストする1行のコードは
echo "My message" | mail -s subject [email protected]