Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Logwatch install example.
#!/usr/bin/env bash
#
# Setup logwatch
# Make sure you already have logwatch (apt-get install logwatch)
#
# <ricky@rickyhewitt.me>
echo "[ Configuring logwatch... ]"
# Writing main config
cat > /etc/logwatch/logwatch.conf <<SCRIPTDOC
LogDir = /var/log
Output = mail
Format = html
Encode = none
MailTo = status@yourdomain.com
MailFrom = logwatch@yourdomain.com
Range = yesterday
Detail = Med
Service = All
mailer = "sendmail -t"
SCRIPTDOC
# Logwatch vnstat config
cat > /etc/logwatch/scripts/services/vnstat <<SCRIPTDOC
#!/usr/bin/env bash
vnstat
SCRIPTDOC
chmod +x /etc/logwatch/scripts/services/vnstat
cat > /etc/logwatch/conf/services/vnstat.conf <<SCRIPTDOC
Title = "vnstat"
LogFile = NONE
SCRIPTDOC
/usr/sbin/logwatch --output mail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.