Skip to content

Send daily summary of actions taken by Fail2Ban #5

@HotBlack77

Description

@HotBlack77

The default logging mechanism of Fail2Ban is quite noisy. It would be great is the plugin supported sending a daily summary instead of actions taken instead of an individual email for each action.

The script below does what I describe. I have never gotten round to understanding how to make a OMV plugin, but I imagine should be pretty easy to have the plugin add this as a cron job and then set Fail2Ban not send mails itself.

Send Summary of last 24H Fail2Ban Actions taken

!/bin/bash

grep "Ban " /var/log/fail2ban.log | grep date +%Y-%m-%d -d yesterday | /usr/bin/sort | /usr/bin/logresolve | /usr/bin/uniq -c | /usr/bin/sort -n | mail -s "Fail2Ban Yesterday Summary date +%Y-%m-%d -d yesterday" name@example.com

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions