| View previous topic :: View next topic |
| Author |
Message |
zgredek Apprentice

Joined: 15 Jun 2005 Posts: 182
|
Posted: Thu Dec 08, 2005 8:07 pm Post subject: Postfix stats? |
|
|
Is there any program that creates graphs, etc. based on the number of delivered/rejected messages + maybe a total number of received/sent mails for each user?
Thx |
|
| Back to top |
|
 |
dashnu l33t

Joined: 21 Jul 2004 Posts: 703 Location: Casco Maine
|
Posted: Thu Dec 08, 2005 8:25 pm Post subject: |
|
|
awstats works well for me.
It will tell you things like so..
Mails successfully sent
Mails failed/refused
Monthly / Daily / Weekly / Hourly Stats
Visitors domains/countries
Hosts
Sender EMail (Mails sent total size average size)
Receiver EMail (Mails received total size average size)
And some other stuff. _________________ write quit bang |
|
| Back to top |
|
 |
splooge l33t

Joined: 30 Aug 2002 Posts: 636
|
Posted: Thu Dec 08, 2005 9:39 pm Post subject: |
|
|
pflogsumm works well also, but it's not graphical, it's text based. It's a good thing to run nightly via cron and e-mail output to whomever you wish it to go to. _________________ http://get.a.clue.de |
|
| Back to top |
|
 |
hanj Veteran


Joined: 19 Aug 2003 Posts: 1236
|
|
| Back to top |
|
 |
zgredek Apprentice

Joined: 15 Jun 2005 Posts: 182
|
Posted: Sat Dec 10, 2005 10:22 pm Post subject: |
|
|
| cacti is not working properly, but it's the best of those i've seen... There're some problem with the graphs not being displayed or some data not showing up, strange... Additionally, postfix supoprt? Anyone? The link on: http://forums.cacti.net/about7314.html&highlight=postfix seems to be broken... |
|
| Back to top |
|
 |
hanj Veteran


Joined: 19 Aug 2003 Posts: 1236
|
Posted: Sat Dec 10, 2005 11:49 pm Post subject: |
|
|
Hello
Give this a try...
http://forums.cacti.net/about1571-0-asc-15.html
[mailgraph-jjp.zip] is the file you want.
I got it working on my system. You need to modify it to work in linux enviro (basically changing the paths). It was originally configured to work in FreeBSD. Just follow the instructions in the INSTALL document.
I'm seeing a nice graph of:
Received
Send
Reject
Bounce
Spam
Virus
Here is my /etc/conf.d/mailgraph
| Code: | MG_POSTFIX_LOG="/var/log/mail.log"
# Specify any extra options here.
# If MG_POSTFIX_LOG is in metalog format, add "-t metalog" to MG_OPTS
MG_OPTS=" --ignore-localhost --ignore-host=spamfilter
|
HTH
hanji |
|
| Back to top |
|
 |
hanj Veteran


Joined: 19 Aug 2003 Posts: 1236
|
Posted: Sun Dec 11, 2005 2:32 am Post subject: |
|
|
Hmmmm
I'm having some problems with the graph. I'll let you know when I have a fix.
hanji |
|
| Back to top |
|
 |
hanj Veteran


Joined: 19 Aug 2003 Posts: 1236
|
Posted: Wed Dec 14, 2005 3:53 am Post subject: |
|
|
Okay. Got things working. A special thanks goes to Volumen1 for helping.. he's a madman.
Here is quick procedure to get Postfix graphing working in cacti. This quick howto assumes you already have postfix, snmp and cacti working.
| Code: | | emerge -v mailgraph |
Grab this file. It's a rework on mailgraph.
http://forums.cacti.net/download.php?id=1925
Information can be found here:
http://forums.cacti.net/about1571-0-asc-15.html
| Code: | cd /usr/local/src
cp /where/you/have/mailgraph-jjp.zip .
unzip mailgraph-jjp.zip
cd mailgraph-jjp |
Need to copy over existing mailgraph script (you may want to back up the original)
| Code: | cp mailgraph.pl /usr/bin/mailgraph
vi /usr/bin/mailgraph
|
Comment out these two lines
| Code: | line 690 #return 1 if $m == $this_minute;
line 691 #return 0 if $m < $this_minute;
|
Set this value (or where ever you have mail logging to) in /etc/conf.d/mailgraph
| Code: | | MG_POSTFIX_LOG="/var/log/mail.log" |
Now copy over the postfixstats.sh script
| Code: | cp /usr/local/src/mailgraph-jjp/postfixstats.sh /usr/local/bin/.
chmod 755 /usr/local/bin/postfixstats.sh
vi /usr/local/bin/postfixstats.sh |
Change
| Code: | | #!/usr/local/bin/bash |
to
Copy over the postfixcheck.pl to cacti scripts directory
| Code: | cp /usr/local/src/mailgraph-jjp/postfixcheck.pl /path/to/cacti/scripts/.
chmod 755 /path/to/cacti/scripts/postfixcheck.pl
vi /path/to/cacti/scripts/postfixcheck.pl |
Add your snmp community string in the perl file
Create the counter files in /var/tmp
| Code: | touch /var/tmp/mailreceived
touch /var/tmp/mailsent
touch /var/tmp/mailrejected
touch /var/tmp/mailbounced
touch /var/tmp/mailspam
touch /var/tmp/mailvirus |
Edit /etc/snmp/snmpd.conf
Add this line to the file and restart snmpd
| Code: | | exec mailcount /usr/local/bin/postfixstats.sh |
| Code: | | /etc/init.d/snmpd restart |
Add mailgraph to runlevel and start it up.
| Code: | rc-update add mailgraph default
/etc/init.d/mailgraph start |
If you have any problems check /var/log/mailgraph.log
At this point you should be seeing counters increment in the /var/tmp files when mails come and go. I would recommend doing the following tests:
| Code: | /usr/local/bin/postfixstats.sh
/path/to/cacti/scripts/postfixcheck.pl localhost |
Make sure you see counters increment.. and then get reset to 0. If that is happening.. you're looking good.
Next add the cacti_graph_template_postfix_processing.xml to cacti graph templates and add the postfix graph. Make sure you set it to localhost.
This is working on my system with the following relevant packages/versions
net-analyzer/net-snmp-5.2.1.2-r1
net-analyzer/cacti-0.8.6g
mail-mta/postfix-2.2.5
net-mail/mailgraph-1.11-r1 (this is overwritten w/diff mailgraph)
HTH
hanji |
|
| Back to top |
|
 |
Dwalin n00b

Joined: 04 Oct 2006 Posts: 2
|
Posted: Wed Oct 04, 2006 11:39 am Post subject: |
|
|
| hanj wrote: | ...
| Code: | | exec mailcount /usr/local/bin/postfixstats.sh | ... |
Hi hanj,
I tried to follow your small how-to, but I could not find "mailcount". Is it a little script? where could I find it?
Thanks for your help
Thomas |
|
| Back to top |
|
 |
Janne Pikkarainen Veteran


Joined: 29 Jul 2003 Posts: 1143 Location: Helsinki, Finland
|
Posted: Wed Oct 04, 2006 12:28 pm Post subject: |
|
|
isoqlog is also very useful. _________________ Yes, I'm the man. Now it's your turn to decide if I meant "Yes, I'm the male." or "Yes, I am the Unix Manual Page.". |
|
| Back to top |
|
 |
hanj Veteran


Joined: 19 Aug 2003 Posts: 1236
|
Posted: Wed Oct 04, 2006 1:15 pm Post subject: |
|
|
| Dwalin wrote: | | hanj wrote: | ...
| Code: | | exec mailcount /usr/local/bin/postfixstats.sh | ... |
Hi hanj,
I tried to follow your small how-to, but I could not find "mailcount". Is it a little script? where could I find it?
Thanks for your help
Thomas |
Hello
It's been awhile.. so trying to wipe the dust off. I believe, and if I'm wrong.. someone please correct me, that the 'mailcount' is like the return variable name. So the /usr/local/bin/postfixstats.sh executes and counts the mails, and returns the value to the mailcount variable. That variable:value is used by cacti.
/usr/local/bin/pastfixstats has the following:
| Code: | #!/bin/bash
for i in sent received rejected bounced spam virus;
do
c=$(/bin/cat /var/tmp/mail$i)
result="${result} ${i}:${c}"
echo 0 > /var/tmp/mail$i
done
echo $result |
So it returns the $result value to the mailcount variable. /cacti/scripts/postfixcheck.pl picks it up.
Hope this helps
hanji _________________ Server Admin Blog - Uno-Code.com | Gentoo Hosting at Rackspace! |
|
| Back to top |
|
 |
Dwalin n00b

Joined: 04 Oct 2006 Posts: 2
|
Posted: Wed Oct 04, 2006 2:00 pm Post subject: |
|
|
| ah ok, now I understand, thanks for the quick help |
|
| Back to top |
|
 |
pydubreucq n00b

Joined: 09 Aug 2007 Posts: 1 Location: France
|
Posted: Thu Aug 09, 2007 4:05 pm Post subject: |
|
|
Hi,
Excuse me I'm French and I don't speak english very well.
I use "Postfix processing" on cacti and I have a problem.
My graph is not complet.
I have the good number of received mail, sent mail... I hope
You could see the result of my graph here :
http://demo-ez.telmedia.net/cacti.jpg
You'll see the good count of received message on current message but not on graph
If you have an idea ?
I will very happy
Thanks for all  |
|
| Back to top |
|
 |
|