Recent Posts

Cara membuat statistik mail.log dari postfix

Kamis, Juni 04, 2015
Terkadang bagi kita para admin linux terutama yang berurusan dengan mail server berbasis postfix adalah kesulitan dalam membaca atau memperoleh statistik dari mail.log. Oleh karena itu saya akan berbagi pengalaman mengenai cara membuat statistik mail.log dari postfix yang saya peroleh dari web site luar.


Tools ini memiliki beberapa fitur, diantaranya : 
  • Total number of:
    • Messages received, delivered, forwarded, deferred, bounced and rejected
    • Bytes in messages received and delivered
    • Sending and Recipient Hosts/Domains
    • Senders and Recipients
    • Optional SMTPD totals for number of connections, number of hosts/domains connecting, average connect time and total connect time
  • Per-Day Traffic Summary (for multi-day logs)
  • Per-Hour Traffic (daily average for multi-day logs)
  • Optional Per-Hour and Per-Day SMTPD connection summaries
  • Sorted in descending order:
    • Recipient Hosts/Domains by message count, including:
      • Number of messages sent to recipient host/domain
      • Number of bytes in messages
      • Number of defers
      • Average delivery delay
      • Maximum delivery delay
    • Sending Hosts/Domains by message and byte count
    • Optional Hosts/Domains SMTPD connection summary
    • Senders by message count
    • Recipients by message count
    • Senders by message size
    • Recipients by message size
    with an option to limit these reports to the top nn.
  • A Semi-Detailed Summary of:
    • Messages deferred
    • Messages bounced
    • Messages rejected
  • Summaries of warnings, fatal errors, and panics
  • Summary of master daemon messages
Lalu bagaimana cara installnya ? tools ini tidak perlu kita install. Cukup download, pilih lokasi dimana kita akan menyimpannya, kemudian untar aplikasinya.

Install
#wget http://jimsun.linxnet.com/downloads/pflogsumm-1.1.1.tar.gz
#tar -zxf pflogsumm-1.1.1.tar.gz
#cp -R ~/pflogsumm-1.1.1/ /var/log/
#chown root:root pflogsumm-1.1.1
#cat /var/log/mail.log.1 | ./pflogsumm-1.1.1/pflogsumm.pl > mail.log

Karena hasilnya terlalu panjang dalam satu layar, maka hasil dari tools diatas saya taruh disebuah file mail.stat

Selamat mencoba :)

Hasilnya :
Grand Totals
------------
messages

   7807   received
  14302   delivered
      0   forwarded
    997   deferred  (60950  deferrals)
    265   bounced
   1389   rejected (8%)
      0   reject warnings
      0   held
      0   discarded (0%)

   2204m  bytes received
   4310m  bytes delivered
    244   senders
     33   sending hosts/domains
   2751   recipients
    638   recipient hosts/domains


Per-Day Traffic Summary
    date          received  delivered   deferred    bounced     rejected
    --------------------------------------------------------------------
    May 25 2015      1872       2674       8088         14        163
    May 26 2015      1444       2450      13549         32        254
    May 27 2015      1381       3377      14030         69        262
    May 28 2015      1471       2461       6721        104        225
    May 29 2015      1356       2397       8248         22        241
    May 30 2015       256        911       8271         21        222
    May 31 2015        27         32       2043          3         22

Tidak ada komentar:

Posting Komentar