Skip to main content

Logwatch

Core​

Install Logwatch​

dnf install -y logwatch

Use default configuration​

cp -f /usr/share/logwatch/default.conf/logwatch.conf /etc/logwatch/conf/logwatch.conf

Configure email address for dalily report​

/etc/logwatch/conf/logwatch.conf
MailTo = support@rectitude.dev
MailFrom = server@noreply.rectitude.dev
Range = yesterday
Detail = Med

Useful commands​

# View report for yesterday
logwatch --range yesterday
# View report for today and send to email
logwatch --range yesterday --mailto support@rectitude.dev
# View report for today with medium detail and send to email
logwatch --range today --detail med --mailto support@rectitude.dev

# Built-in service configuration
cd /usr/share/logwatch/default.conf/

Schedule a daily logwatch report​

Run crontab -e

00 04 * * * /usr/sbin/logwatch --range yesterday --mailto support@rectitude.dev

Custom Service Configuration​

Modsecurity​

/etc/logwatch/conf/services/modsecurity.conf
Title = "ModSecurity Alerts"
LogFile = modsecurity

Inotify File Monitor​

/etc/logwatch/conf/services/inotify-file-monitor.conf
Title = "Inotify Monitor Alerts"
LogFile = inotify-file-monitor

Linux Malware Detect​

/etc/logwatch/conf/services/maldetect.conf
Title = "Linux Malware Detect (LMD) "
LogFile = maldetect

Rootkit Hunter​

/etc/logwatch/conf/services/rkhunter.conf
Title = "Rootkit Hunter"
LogFile = rkhunter

Monit​

/etc/logwatch/conf/services/monit.conf
Title = "Monit"
LogFile = monit

WWW Backup​

/etc/logwatch/conf/services/wwwbackup.conf
Title = "WWW Backup"
LogFile = wwwbackup

Mariadb Slowlog​

/etc/logwatch/conf/services/mariadb-slowlog.conf
Title = "Mariadb Slowlog"
LogFile = mariadb-slowlog

Mariadb Errorlog​

/etc/logwatch/conf/services/mariadb-errorlog.conf
Title = "Mariadb Errorlog"
LogFile = mariadb-errorlog