Postfixのログ解析awstats

awstatsインストール

cd /usr/ports/www/awstats
make install clean

postfix用のログ解析設定ファイル作成
cd /usr/local/www/awstats/cgi-bin
cp awstats.model.conf awstats.mail.conf

ee awstats.mail.conf 編集

LogFile="perl /usr/local/www/awstats/tools/maillogconvert.pl standard < /var/log/maillog |"

LogType=M

LogFormat="%time2 %email %email_r %host %host_r %method %url %code %byt

SiteDomain="tommybsd.plala.jp"

メールサーバーログ解析に不要な下記項目を無効化
LevelForBrowsersDetection=0
LevelForOSDetection=0
LevelForRefererAnalyze=0
LevelForRobotsDetection=0
LevelForSearchEnginesDetection=0
LevelForKeywordsDetection=0
LevelForFileTypesDetection=0
LevelForWormsDetection=0

cron登録

ee /etc/crontab

↓ 下記を追加
# postfix awstats
40      23      *       *       *       root /usr/local/www/awstats/cgi-bin/awstats.pl -config=mail

ブラウザで確認 ( http://tommybsd.plala.jp/awstats/awstats.pl?config=mail )

awstats

This entry was posted in FreeBSD. Bookmark the permalink.