maillog をサマる
環境
準備
pflogsumm をインストール。
# yum install postfix-perl-scripts
↑忘れちゃったときは yum search postfix
概要
maillog をわかりやすく説明してくれる。パフォーマンスは ZABBIX とかを利用するとして、運用時の細かいトラブルシューティングなどに有用。
# pflogsumm /var/log/maillog Grand Totals ------------ messages 3006 received 3006 delivered 0 forwarded 0 deferred 0 bounced 10 rejected (0%) 0 reject warnings 0 held 0 discarded (0%) 11982k bytes received 11989k bytes delivered 3 senders 1 sending hosts/domains 3 recipients 1 recipient hosts/domains Per-Hour Traffic Summary time received delivered deferred bounced rejected -------------------------------------------------------------------- 0000-0100 0 0 0 0 0 0100-0200 0 0 0 0 0 0200-0300 0 0 0 0 0 0300-0400 0 0 0 0 0 0400-0500 0 0 0 0 0 0500-0600 0 0 0 0 0 0600-0700 0 0 0 0 0 0700-0800 0 0 0 0 0 0800-0900 0 0 0 0 0 0900-1000 0 0 0 0 0 1000-1100 0 0 0 0 0 1100-1200 0 0 0 0 0 1200-1300 0 0 0 0 0 1300-1400 0 0 0 0 0 1400-1500 0 0 0 0 0 1500-1600 0 0 0 0 0 1600-1700 0 0 0 0 0 1700-1800 0 0 0 0 0 1800-1900 0 0 0 0 0 1900-2000 0 0 0 0 0 2000-2100 0 0 0 0 0 2100-2200 0 0 0 0 0 2200-2300 1535 1535 0 0 0 2300-2400 1471 1471 0 0 10 Host/Domain Summary: Message Delivery sent cnt bytes defers avg dly max dly host/domain -------- ------- ------- ------- ------- ----------- 3006 11989k 0 0.1 s 0.6 s example.jp Host/Domain Summary: Messages Received msg cnt bytes host/domain -------- ------- ----------- 3003 11982k example.jp Senders by message count ------------------------ 1582 bbb@example.jp 1413 aaa@example.jp 8 bbb.xxx@example.jp Recipients by message count --------------------------- 1583 aaa@example.jp 1415 bbb@example.jp 8 ccc@example.jp Senders by message size ----------------------- 7976k aaa@example.jp 3957k bbb@example.jp 49936 bbb.xxx@example.jp Recipients by message size -------------------------- 7983k bbb@example.jp 3957k aaa@example.jp 49936 ccc@example.jp message deferral detail: none message bounce detail (by relay): none message reject detail --------------------- RCPT Recipient address rejected: User unknown in local recipient table (total: 10) 9 unknown-user@example.jp 1 ddd@example.jp message reject warning detail: none message hold detail: none message discard detail: none smtp delivery failures: none Warnings -------- smtpd (total: 5) 4 unknown[192.168.141.148]: SASL LOGIN authentication failed: aut... 1 connect to Milter service inet:127.0.0.1:10025: Connection refused Fatal Errors: none Panics: none Master daemon messages ---------------------- 1 reload -- version 2.6.6, configuration /etc/postfix
注意
Postfix をインストールする時に併せてインストールを済ませておくこと。後からインストールしようとすると、Postfix がアップデート対象になってしまう。簡単な Perl のスクリプトなので、後から設置することも可能。
下記のファイルがインストールされる。
[root@xmta log]# rpm -ql postfix-perl-scripts | xargs /bin/ls -lF --full-time -rwxr-xr-x. 1 root root 54815 2014-02-20 19:07:52.000000000 +0900 /usr/sbin/pflogsumm* -rwxr-xr-x. 1 root root 12846 2014-02-20 19:07:52.000000000 +0900 /usr/sbin/qshape* -rw-r--r--. 1 root root 29698 2014-02-20 19:07:52.000000000 +0900 /usr/share/doc/postfix-2.6.6/pflogsumm-faq.txt -rw-r--r--. 1 root root 7084 2014-02-20 19:07:52.000000000 +0900 /usr/share/man/man1/pflogsumm.1.gz -rw-r--r--. 1 root root 1961 2014-02-20 19:07:52.000000000 +0900 /usr/share/man/man1/qshape.1.gz