Skip to content

Instantly share code, notes, and snippets.

@rickyhewitt
Created February 3, 2016 11:45
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save rickyhewitt/54317589fbbf44462bfe to your computer and use it in GitHub Desktop.
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