Mail statistics RRDtool frontend for Postfix,利用RRDtool搭配Postfix統計出每日、週、月、年的郵件紀錄,並以圖表顯示郵件的收、送、拒絕、病毒、廣告信等流

1.
cpan2rpm -i Time::HiRes
cpan2rpm -i File::Tail
apt-get install rrdtool

2.
wget http://people.ee.ethz.ch/~dws/software/mailgraph/pub/mailgraph-1.12.tar.gz


tar zxvf mailgraph-1.12.tar.gz
cd mailgraph-1.12

3.
mkdir /var/www/html/mailgraph
cp mailgraph.cgi /var/www/html/mailgraph
chmod 755 /var/www/html/mailgraph/mailgraph.cgi
cp mailgraph.pl /usr/local/bin
chmod 755 /usr/local/bin/mailgraph.pl
cp mailgraph-init /etc/init.d/mailgraph
chmod 755 /etc/init.d/mailgraph

3.
vi /etc/init.d/mailgraph

MAIL_LOG=/var/log/maillog
RRD_DIR=/var/www/html/mailgraph

4.
/etc/init.d/mailgraph start

5.
ps axu|grep mail

/usr/bin/perl -w /usr/local/bin/mailgraph.pl -l /var/log/maillog -d –daemon-pid=/var/run/mailgraph.pid –daemon-rrd=/var/www/html/mailgraph

6.
vi /etc/httpd/conf/httpd.conf

ScriptAlias /mailgraph "/var/www/html/mailgraph/"

service httpd graceful

7.
http://ip/mailgraph/mailgraph.cgi

Q1. Can't locate RRDs.pm in @INC (@INC contains:
A1. apt-get install perl-rrdtool

Q2. Can't locate File/Tail.pm in @INC (@INC contains:
A2. cpan2rpm -i File::Tail

 

 

Related posts 相關文章
使用 Graylog 收集、管理 log 事件記錄
More...
解決 RRDTOOL 的圖突然有很大的值
More...
collectd 監控主機,把資料丟給 influxdb + grafana
More...
指令 command-line 匯出 Windows 事件檢視器記錄
More...

作者

留言

撰寫回覆或留言

發佈留言必須填寫的電子郵件地址不會公開。