Postfix monitoring with David Schweikert's Mailgraph?
Moderators: Developers, Moderators
Postfix monitoring with David Schweikert's Mailgraph?
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
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
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.
It would be nice seeing this adapted to cacti.
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?
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?
I almost have it
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.
/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 (54.27 KiB) Viewed 117972 times
mailgraph templates.
i got some templates from the master. feel free to email/pm me for it.
or aim tchmnkyz
--jeremy
or aim tchmnkyz
--jeremy
postfix-stuff
Hi there
is anyone having templates for postfix?
it would be very nice, if someone would post them..
thanx
mänu
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.
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:
I've attached the modified mailgraph.pl.
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
- Attachments
-
- Postfix graph
- postfix_graph.png (11.44 KiB) Viewed 117754 times
-
- mailgraph.pl.gz
- updated mailgraph
- (4.83 KiB) Downloaded 11017 times
-
- Cacti User
- Posts: 52
- Joined: Fri Mar 12, 2004 3:01 am
- Location: Beusichem
- Contact:
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
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.
-
- Cacti User
- Posts: 52
- Joined: Fri Mar 12, 2004 3:01 am
- Location: Beusichem
- Contact:
Great! I'll check this the next few weeks. This would be a great enhancement for my server monitoring.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
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.
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 11017 times
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!
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!
Who is online
Users browsing this forum: No registered users and 7 guests