Please help us improve HowtoForge and take our survey:
Postfix Monitoring With Mailgraph And pflogsumm - Page 3
4 Fedora Core 5
4.1 MailgraphThere's no Mailgraph package available for Fedora Core 5, so we must install it manually. First, we need to install the prerequsities that Mailgraph requires: yum install rrdtool rrdtool-perl perl-File-Tail Then we download the Mailgraph sources and copy the Mailgraph scripts to the appropriate locations: cd /tmp Now we must adjust the Mailgraph init script /etc/init.d/mailgraph: vi /etc/init.d/mailgraph On Fedora, the Postfix mail log is /var/log/maillog, so we change
to
Then we add another variable to /etc/init.d/mailgraph, IGNORE_LOCALHOST. If you have integrated a content filter like amavisd into Postfix, add this line
to the block where the variables like MAIL_LOG are defined. If you don't use a content filter, add this line instead:
In both cases, change
to
So the final script should look like this (in this case, with --ignore-localhost enabled):
Next we make the script executable, create the appropriate system startup links and start Mailgraph: chmod 755 /etc/init.d/mailgraph Still in the /tmp/mailgraph-1.12 directory, we move mailgraph.cgi to our cgi-bin directory: mv mailgraph.cgi /var/www/www.example.com/cgi-bin/ Now we open the file and adjust the locations of the two Mailgraph databases. vi /var/www/www.example.com/cgi-bin/mailgraph.cgi Change
to
Then we make the script executable: chmod 755 /var/www/www.example.com/cgi-bin/mailgraph.cgi If you use suExec for the www.example.com web site, you must chown mailgraph.cgi to the appropriate owner and group. Now direct your browser to http://www.example.com/cgi-bin/mailgraph.cgi, and you should see some graphs. Of course, there must be some emails going through your system before you see the first results, so be patient.
4.2 pflogsummThe steps differ only slightly from those on Debian and Ubuntu. The main difference is that Postfix logs to /var/log/maillog on Fedora instead of /var/log/mail.log (Debian/Ubuntu) (pay attention to the dot!). First we install pflogsumm: yum install postfix-pflogsumm We want pflogsumm to be run by a cron job each day and send the report to postmaster@example.com. Therefore we must configure our system that it writes one mail log file for 24 hours, and afterwards starts the next mail log so that we can feed the old mail log to pflogsumm. Therefore we configure logrotate (that's the program that rotates our system's log files) like this: open /etc/logrotate.conf and append the following stanza to it, after the line # system-specific logs may be configured here: vi /etc/logrotate.conf
Also change /etc/logrotate.d/syslog vi /etc/logrotate.d/syslog from
to
There's a logrotate script in /etc/cron.daily. This script is called everyday between 06:00h and 07:00h. With the configuration we just made, it will copy the current Postfix log /var/log/maillog to /var/log/maillog.0 and compress it, and the compressed file will be /var/log/maillog.0.gz. It will also create a new, empty /var/log/maillog to which Postfix can log for the next 24 hours. Now we create the script /usr/local/sbin/postfix_report.sh which invokes pflogsumm and makes it send the report to postmaster@example.com: vi /usr/local/sbin/postfix_report.sh
We must make this script executable: chmod 755 /usr/local/sbin/postfix_report.sh Then we create a cron job which calls the script everyday at 07:00h: crontab -e
This will send the report to postmaster@example.com.
5 Links
|






print: 
Recent comments
1 day 10 hours ago
1 day 12 hours ago
1 day 16 hours ago
3 days 9 hours ago
3 days 10 hours ago
3 days 10 hours ago
5 days 12 hours ago
6 days 20 hours ago
1 week 12 hours ago
1 week 16 hours ago