Last active
February 7, 2024 16:28
Star
You must be signed in to star a gist
Send Pushover notification from Fail2Ban
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fail2Ban configuration file | |
# | |
[Definition] | |
# Notify on Startup | |
actionstart = /usr/bin/curl -s -F "token=<token>" -F "user=<user>" -F "title=[Fail2Ban] <name>" -F "message=Jail <name> has been started successfully." https://api.pushover.net/1/messages | |
# Notify on Shutdown | |
actionstop = /usr/bin/curl -s -F "token=<token>" -F "user=<user>" -F "title=[Fail2Ban] <name>" -F "message=Jail <name> has been stopped." https://api.pushover.net/1/messages | |
# | |
actioncheck = | |
# Notify on Banned | |
actionban = /usr/bin/curl -s -F "token=<token>" -F "user=<user>" -F "title=[Fail2Ban] <name>" -F "message=Banned IP: <ip> Lines containing IP: `grep '<ip>' <logpath>`" https://api.pushover.net/1/messages | |
# Notify on Unbanned | |
actionunban = | |
[Init] | |
# Defaut name of the chain | |
name = default | |
# Application token key | |
token = | |
# User API key | |
user = |
This script sends IP's re-banned notification every time when I restart fail2ban (stop and start or just use restart commands). Any way to disable pushover notifications when fail2ban, re-banned IP's on restarting its service?
I already checked fail2ban/config/action.d/complain.conf file,
# bypass ban/unban for restored tickets
norestored = 1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I managed to run it :) Thank you so much. Could you please help me out how can I get notification when something unban
actionunban =
Thank you :)