Created
February 3, 2016 11:45
-
-
Save rickyhewitt/54317589fbbf44462bfe to your computer and use it in GitHub Desktop.
Logwatch install example.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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