[1.]
wget http://taz.net.au/postfix/mrtg/update-mailstats.pl
wget http://taz.net.au/postfix/mrtg/mailstats.pl
wget http://taz.net.au/postfix/mrtg/mrtg-mailstats.pl
chmod u+x update-mailstats.pl mailstats.pl mrtg-mailstats.pl
mv update-mailstats.pl mailstats.pl mrtg-mailstats.pl /usr/local/bin
[2.]
yum install perl-File-Tail
[3.]
vi /usr/loca/bin/update-mailstats.pl
$mail_log = '/var/log/maillog' ;
$stats_file = '/tmp/stats.db' ;
統計資料,於/tmp下產生stats.db
update-mailstats.pl &
show raw data
mailstats.pl
[4.]
vi mrtg.cf
WorkDir: /var/www/mrtg/mailstats
#—————————————————————#
# MRTG mail cfg: Postfix mailstats plotting with MRTG #
#—————————————————————#
Target[postfix]: `/usr/local/bin/mrtg-mailstats.pl`MaxBytes[postfix]: 123456
Options[postfix]: gauge, growright
WithPeak[postfix]: dwmy
YLegend[postfix]: No. of messages
ShortLegend[postfix]: messages
LegendI[postfix]: Incoming:
LegendO[postfix]: Outgoing:
Title[postfix]: Postfix Statistics
PageTop[postfix]: <H1>Postfix Statistics</H1>
mkdir /var/www/mrtg/mailstats
mrtg mailstats.mrtg.cfg
ref: http://taz.net.au/postfix/mrtg/
留言