Setting up pflogsumm on CentOS to run nightly

Here is a small post on how to setup pflogsumm on your CentOS mail server running Postfix.  It takes advantage of logrorate being called nightly by cron.
1. Install pflogsumm
# wget http://jimsun.linxnet.com/downloads/pflogsumm-1.1.3.tar.gz
# tar zxvf pflogsumm-1.1.3.tar.gz
2. Run a test
# cat /var/log/maillog | ./pflogsumm.pl
3. Update /etc/logrotate.d/syslog.  Add the following:
 prerotate
    cat /var/log/maillog | ./path_to_pflogsumm/pflogsumm.pl | mail -s "Postfix Logs Summary `date`" your-email-address
 endscript

Nhận xét

Bài đăng phổ biến