this is obsolete doc -- see instead

Daily mail reports with logwatch 



Basic configuration 

Configure logwatch, 

cd /usr/share/logwatch/default.conf
mv logwatch.conf logwatch.conf.dist
sed '/^$/d; /^#/d;' logwatch.conf.dist > logwatch.conf


Detail = High
#Service = "-zz-network"     # Prevents execution of zz-network service
#Service = "-zz-sys"         # Prevents execution of zz-sys service

Note. we prefer to edit the defaults instead if local configs (/etc/logwatch/conf/logwatch.conf) as we couldn't comment some services on the latter. 

Note. those perl modules are required to get CPU and mem info, 

perl -MCPAN -e 'install Sys::CPU'
perl -MCPAN -e 'install Sys::MemInfo'



HTML output and template 

Note Redhat RHEL 5.1 logwatch is broken about that. Use RHEL 5.2's logwatch package or superior. 


Change logwatch reports's output to html, 

vi /etc/cron.daily/0logwatch


$Config{'output'} = "html";

Note. that cron is a symlink to "/usr/share/logwatch/scripts/" 


Edit the template, 

cd /usr/share/logwatch/default.conf/html
mv header.html header.html.dist
vi header.html


 <style type="text/css">
        *  { font-size:10px; font-family:Arial,Verdana }
        td { border:0 }
        h1 { font-size: 150%; margin-bottom:0; padding-bottom:0 }
        h2 { font-size:135%; margin-bottom:0; padding-bottom:0 }
        h3 { font-size:120%; margin-bottom:0; padding-bottom:0 }
<!-- End header.html -->

note. no espaces in from of doublequotes here, despide the default html code 

note. we don't need title no h1, the hostname will appear in message's subjet anyway 


mv footer.html footer.html.dist
vi footer.html


<!-- Start footer.html -->


You'll also want to fix table borders, 

vi /etc/cron.daily/0logwatch

change this line, 

<table border=\"1\">\n";