Samuel Stanislav
Samuel Stanislav

Reputation: 31

fail2ban repeatedly sends notifications

we re facing issue with fail2ban.

Our setup for example:

jail.conf:

[nginx-404]

enabled = true
port    = http,https
filter  = nginx-404
logpath = /var/log/nginx/*access.log
maxretry = 5
findtime = 300
action = mail

than action:

[Definition]

actionstart =
actionstop =
actioncheck =

actionban = printf %%b "Hi,\n
            The IP <ip> has just been banned by Fail2Ban after
            <failures> attempts against <name>.\n
            Regards,\n
            Fail2Ban"|mail -s "[Fail2Ban] <name>: banned <ip> from `uname -n`" <dest>

actionunban =

After restart service or reboot system. It send immediately all bans which were done before.

Is there any solution to stop sending hundreds notifications after restart ? Thanks for anyadvice.

Upvotes: 0

Views: 286

Answers (1)

sebres
sebres

Reputation: 820

Is there any solution to stop sending hundreds notifications after restart ?

Yes. Just specify norestored = true in your action. See PR #1669 for more info.

Upvotes: 1

Related Questions