Fail2Ban Entries Not Listed in Logwatch
Systems affected: Fedora 37 – 40
Update
It appears at times updates will reset the changes made below. So – I created a new solution
Create a file named /etc/cron.daily/00LogwatchDetail and insert the following
#!/bin/bash sed -i "s/my\s*\$Detail\s*=\s*\$ENV{'LOGWATCH_DETAIL_LEVEL'}\s*||\s*0/my \$Detail = \$ENV{'LOGWATCH_DETAIL_LEVEL'} || 1/" /usr/share/logwatch/scripts/services/fail2ban
make sure you
chmod 700 /etc/cron.daily/00LogwatchDetail
The above will check the /usr/share/logwatch/scripts/services/fail2ban to make sure it is set correctly every day
Install fail2ban as needed. Information is being logged correctly to /var/log/fail2ban. Updates executed by fail2ban are not reported in logwatch.
Correction:
edit /usr/share/logwatch/scripts/services/fail2ban
Find the line:
my $Detail = $ENV{'LOGWATCH_DETAIL_LEVEL'} || 0;
change it to be:
my $Detail = $ENV{'LOGWATCH_DETAIL_LEVEL'} || 1;
Additional Notes:
Testing logwatch –
Get a report just on the screen just about the service fail2ban
/usr/sbin/logwatch --detail 1 --service fail2ban