pflogsumm
Telepítsük fel a postfix logjainak az elemzésére alkotott
szoftvert:
# apt-get install pflogsumm
# zcat /var/log/GEPEK/192.168.10.252/postfix.1.gz | \ pflogsumm -d yesterday -i --problems_first -q --smtpd_stats | \ mailx -s "Levelezési statisztika: `/bin/date --date '-1 day' +%Y%m%d`" atkosa@akarmi.intra
A fenti parancs hatására kapunk egy ilyen e-mail-t (jó esetben nem ennyire üreset, hanem hasznos adatokat tartalmazót):
Date: Wed, 4 Apr 2007 22:44:55 +0200 (CEST)
From: root@syslog.akarmi.intra (root)
To: atkosa@akarmi.intra
Subject: Levelezési statisztika: 20070403
Postfix log summaries for Apr 3
Grand Totals
------------
messages
0 received
0 delivered
0 forwarded
0 deferred
0 bounced
0 rejected (0%)
0 reject warnings
0 held
0 discarded (0%)
0 bytes received
0 bytes delivered
0 senders
0 sending hosts/domains
0 recipients
0 recipient hosts/domains
smtpd
0 connections
0 hosts/domains
0 avg. connect time (seconds)
0:00:00 total connect time
Fatal Errors: none
Panics: none
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 0 0 0 0 0
2300-2400 0 0 0 0 0
Host/Domain Summary: Message Delivery
sent cnt bytes defers avg dly max dly host/domain
-------- ------- ------- ------- ------- -----------
Host/Domain Summary: Messages Received
msg cnt bytes host/domain
-------- ------- -----------
Per-Hour SMTPD Connection Summary
hour connections time conn. avg./conn. max. time
--------------------------------------------------------------------
Host/Domain Summary: SMTPD Connections
connections time conn. avg./conn. max. time host/domain
----------- ---------- ---------- --------- -----------
Ha működik, és ezt szeretnénk, akkor már csak el kell helyeznünk
például a /etc/cron.daily könyvtárban, egy
pflogsumm nevű fájlban12.1 a fenti parancsokat.
Kosa Attila
2009-03-23