Skip to content

Instantly share code, notes, and snippets.

@rickyhewitt
Created February 3, 2016 11:45
Show Gist options
  • Save rickyhewitt/54317589fbbf44462bfe to your computer and use it in GitHub Desktop.
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)
#
# <[email protected]>
echo "[ Configuring logwatch... ]"
# Writing main config
cat > /etc/logwatch/logwatch.conf <<SCRIPTDOC
LogDir = /var/log
Output = mail
Format = html
Encode = none
MailTo = [email protected]
MailFrom = [email protected]
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