Postfix monitoring with David Schweikert's Mailgraph?

Templates, scripts for templates, scripts and requests for templates.

Moderators: Moderators, Developers

Post Reply
Author
Message
amb_
Posts: 1
Joined: Sun Apr 06, 2003 7:15 pm
Location: Canada
Contact:

Postfix monitoring with David Schweikert's Mailgraph?

#1 Post by amb_ » Sun Apr 06, 2003 7:29 pm

Hello,

David Schweikert has maintained a very handy comprehensive Postfix monitoring frontend for RRDtool called Mailgraph. It takes the form of a daemon Perl and a CGI to generate the graphs via the web. It can be found at http://people.ee.ethz.ch/~dws/software/mailgraph/.

Has anyone successfully adapted this to Cacti? I am about to attempt to do so myself but would like to avoid readapting the wheel, if at all possible.

Should no one in this community have already done the above, I will be sure to post my reworked Mailgraph in the User Contributions forum once I am through.

Many thanks to Ian Berry et al for a fantastic piece of software. Keep up the great work!

Chris Slothouber
Threshold Internet Solutions

Xanatos

#2 Post by Xanatos » Sun Apr 06, 2003 7:51 pm

I would LOVE to see this. Hell I didn't even know there was any monitoring solutions for Postfix. I moved over about 5 months ago from Qmail and LOVE IT. Definately the best MTA I've used. Have it integrated with MySQL, Courier, and SpamAssassin and it flys.

It would be nice seeing this adapted to cacti.

zachf

#3 Post by zachf » Wed May 14, 2003 8:50 pm

any luck with this yet?

would be awesome to see it working... :)

klavs
Posts: 18
Joined: Tue Oct 01, 2002 8:36 am

#4 Post by klavs » Tue Sep 16, 2003 3:36 am

I've got mailgraph running - and cacti makes graphs from the rrd's - only the numbers aren't exactly correct ;) - I'm working on getting the calculations that mailgraph.cgi does into cacti - but I don't know how?

How far have you gotten ? - what I need to get of calculations (CDEF's) are these:

"CDEF:rsent=sent,60,*",
"CDEF:rrecv=recv,60,*",
"CDEF:rmsent=msent,60,*",
"CDEF:rmrecv=mrecv,60,*",
they are done - now easy.

Here's the kickers I can't solve:

"CDEF:dsent=sent,UN,0,sent,IF,$step,*",
"CDEF:ssent=PREV,UN,dsent,PREV,IF,dsent,+",
"CDEF:drecv=recv,UN,0,recv,IF,$step,*",
"CDEF:srecv=PREV,UN,drecv,PREV,IF,drecv,+",

How do I get that into Cacti? any ideas?

cpdans
Posts: 43
Joined: Mon Oct 28, 2002 7:59 am

#5 Post by cpdans » Fri Dec 19, 2003 12:56 pm

Hello,

Has anyone gotten any closer to this? I too have been running mailgraph and would love to get the graphs into Cacti. Any help with this would be great.

Dan

Guest

#6 Post by Guest » Tue Feb 03, 2004 12:48 pm

Any updates with this?

travisll
Posts: 7
Joined: Mon Jul 08, 2002 12:59 pm

I almost have it

#7 Post by travisll » Tue Feb 03, 2004 2:56 pm

I ave not been able to get all the DEFS correct yet but this is what I have so far.



/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-60 \
--title="SA Messages" \
--base=1000 \
--height=150 \
--width=540 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="msgs/sec" \
DEF:a="/usr/local/apache/htdocs/cacti/rra/mailgraph.rrd":sent:AVERAGE \
DEF:b="/usr/local/apache/htdocs/cacti/rra/mailgraph.rrd":recv:AVERAGE \
CDEF:cdefa=a,60,* \
CDEF:cdefb=a,UN,0,a,IF,480,* \
CDEF:cdefc=PREV,UN,cdefb,PREV,IF,cdefb,+ \
CDEF:cdeff=b,60,* \
CDEF:cdefg=b,UN,0,b,IF,480,* \
CDEF:cdefh=PREV,UN,cdefg,PREV,IF,cdefg,+ \
AREA:cdefa#4123A1:"Sent" \
COMMENT:"" \
GPRINT:cdefc:MAX:" total\:%8.0lf" \
GPRINT:cdefa:AVERAGE:"average\: %.2lf msgs/min" \
GPRINT:cdefa:MAX:"max\: %.0lf msgs/min\n" \
LINE2:cdeff#009900:"Recieved" \
COMMENT:"" \
GPRINT:cdefh:MAX:"total\:%8.0lf" \
GPRINT:cdeff:AVERAGE:"average\: %.2lf msgs/min" \
GPRINT:cdeff:MAX:"max\: %.0lf msgs/min\n" \
HRULE:0#000000:"" \
COMMENT:"\s" \
COMMENT:"graph created on Tue 03 Feb 13:46:05 CST 2004 \r"

The graph is as follows. Notice the nax: msgs/min are goofed up. That is all I lack for the first graph.
Attachments
sa_graph.png
sa_graph.png (54.27 KiB) Viewed 108865 times

dgman
Posts: 19
Joined: Wed Nov 12, 2003 12:30 pm
Contact:

mailgraph templates.

#8 Post by dgman » Fri Feb 13, 2004 3:02 pm

i got some templates from the master. feel free to email/pm me for it.


or aim tchmnkyz


--jeremy

maenu
Cacti User
Posts: 57
Joined: Thu Jul 17, 2003 8:55 am
Location: Switzerland

postfix-stuff

#9 Post by maenu » Thu Apr 01, 2004 7:13 am

Hi there

is anyone having templates for postfix?

it would be very nice, if someone would post them..

thanx

mänu
To know recursion, you must first know recursion.

Speedster
Posts: 27
Joined: Wed Feb 11, 2004 7:53 pm
Location: Perth, Australia

#10 Post by Speedster » Fri Apr 02, 2004 2:55 am

I modified the perl script for mailgraph to output the values to text files rather than create an RRD, then extended the net-snmp agent to include those files. Then I just pull the values with an snmp query and let cacti create it's own RRD files.

snmpd.conf:

Code: Select all

exec   mailcount_sent           /bin/cat /var/tmp/mailsent
exec   mailcount_recv           /bin/cat /var/tmp/mailrecv
exec   mailcount_reject         /bin/cat /var/tmp/mailrejected
exec   mailcount_bounced        /bin/cat /var/tmp/mailbounced
exec   mailcount_spam           /bin/cat /var/tmp/mailspam
exec   mailcount_virus          /bin/cat /var/tmp/mailvirus
I've attached the modified mailgraph.pl.
Attachments
postfix_graph.png
Postfix graph
postfix_graph.png (11.44 KiB) Viewed 108647 times
mailgraph.pl.gz
updated mailgraph
(4.83 KiB) Downloaded 10464 times

..::BFS::..
Cacti User
Posts: 52
Joined: Fri Mar 12, 2004 3:01 am
Location: Beusichem
Contact:

#11 Post by ..::BFS::.. » Fri Apr 02, 2004 4:02 am

Is it possible to use this for Win32 environments to? So to port it to Exchange or Mdeamon?

maenu
Cacti User
Posts: 57
Joined: Thu Jul 17, 2003 8:55 am
Location: Switzerland

#12 Post by maenu » Fri Apr 02, 2004 7:07 am

veeery cool!!

thank you very much..

in addition, you have to add the following perl-moduls to run the script:
Time::HiRes (needed by Time::Local)
Time::Local
File::Tail
Getopt::Long

@Speedster:
Thanx for posting the script!!
it would be very nice, if you'd export the data-template and graph-template..

@BFS
this script is almost useless for mdaemon and exchange.
it parses the specific logfile of Postfix..
other MTA's like exchange have diffrent logfile-formats.

Exchange isn't a big problem.. (I hope so.. ) because there's a Performance MIB for the windows-integrated SNMP-Service.

I plan to realize the exchange-solution, in the next few weeks.
I'll post it here..

regards,
Mänu
To know recursion, you must first know recursion.

..::BFS::..
Cacti User
Posts: 52
Joined: Fri Mar 12, 2004 3:01 am
Location: Beusichem
Contact:

#13 Post by ..::BFS::.. » Fri Apr 02, 2004 8:43 am

maenu wrote:
@BFS
this script is almost useless for mdaemon and exchange.
it parses the specific logfile of Postfix..
other MTA's like exchange have diffrent logfile-formats.

Exchange isn't a big problem.. (I hope so.. ) because there's a Performance MIB for the windows-integrated SNMP-Service.

I plan to realize the exchange-solution, in the next few weeks.
I'll post it here..

regards,
Mänu
Great! I'll check this the next few weeks. This would be a great enhancement for my server monitoring.

Enforcer
Posts: 10
Joined: Thu Apr 08, 2004 1:06 pm

#14 Post by Enforcer » Thu Apr 08, 2004 1:10 pm

Hi,

i saw what you did here. I liked it a lot but well i also had to create all the templates.
All that clicking and adjustment took me some time so i decided to make it public.

So here we go. That templates are working if you have the exec stuff in the snmpd at the top or the postfix stats entry’s are the only one.

Thx for that idea and script.
Attachments
cacti_graph_template_postfix_stats.xml
Data and Graph Template
(32.77 KiB) Downloaded 10189 times

Speedster
Posts: 27
Joined: Wed Feb 11, 2004 7:53 pm
Location: Perth, Australia

#15 Post by Speedster » Mon Apr 12, 2004 10:01 am

Nice work enforcer :)

Sorry for not getting around to posting my templates! The data templates were just straight "Get SNMP Query" data sources (one for each type of data) so I'm not sure they could have helped anyone. It was one of the first things I did in Cacti and because the OID is different on each server I couldn't template it!

Post Reply