Skip to content

Instantly share code, notes, and snippets.

@eksiscloud
Created April 22, 2020 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eksiscloud/6d8cddbee2ac37891db59f6786327052 to your computer and use it in GitHub Desktop.
Save eksiscloud/6d8cddbee2ac37891db59f6786327052 to your computer and use it in GitHub Desktop.
Monit: Fail2ban
Fail2ban
check process fail2ban with pidfile /var/run/fail2ban/fail2ban.pid
group services
start program = "/etc/init.d/fail2ban force-start"
stop program = "/etc/init.d/fail2ban stop || :"
if failed unixsocket /var/run/fail2ban/fail2ban.sock then restart
if 5 restarts within 5 cycles then timeout
check file fail2ban_log with path /var/log/fail2ban.log
if match "ERROR|WARNING" then alert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment