Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Monitoring, Postfix

Using Pflogsumm Postfix Log Analyzer

Submitted by on December 4, 2014 – 12:29 am

Pflogsumm is an oldie but a goodie. It’s a Perl script that sifts through your Postfix server maillog and provides you with a neat summary of events and some statistics. This information can be useful in detecting sudden changes in your normal mail flow. Here’s how to install pflogsumm on CentOS/RHEL:

First, some prerequisites for Perl:

yum install perl-Date-Calc

Now pflogsumm itself:
mkdir -p /usr/local
cd /usr/local/
curl -O http://jimsun.linxnet.com/downloads/pflogsumm-1.1.3.tar.gz
tar -xzf pflogsumm-1.1.3.tar.gz
/bin/mv pflogsumm-1.1.3 pflogsumm
chmod +x pflogsumm/pflogsumm.pl

A sample run:
perl /usr/local/pflogsumm/pflogsumm.pl /var/log/maillog

A more practical example using cron to email you daily stats of your Postfix server activities:
0 0 * * * perl /usr/local/pflogsumm/pflogsumm.pl /var/log/maillog | mailx -s "`hostname` Postfix Summary for `date +'%Y-%m-%d'`" you@yourdomain.com >/dev/null 2>&1

 

Print Friendly, PDF & Email

Leave a Reply