Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Thu Apr 27, 2017 1:56 am

All times are UTC - 5 hours

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Graphing Mailgraph RRDs
PostPosted: Wed Mar 07, 2007 1:44 pm 

Joined: Fri Mar 02, 2007 8:44 pm
Posts: 19
I've seen the posts and suggestions on "integrating" Mailgraph with Cacti, many of which rely on changing the log watching script to just put the numbers somewhere that snmpd can get to them and pulling them off that way. However, I have a year's worth of data already in RRDs, and I'd like to keep access to it. So far, I've been mostly successful. Copying the RRD by hand (temporarily), I was able to get mostly accurate graphs with this setup:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="|host_description| - Mailgraph" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--units-exponent=0 \
--vertical-label="msgs/min" \
--slope-mode \
DEF:a="/usr/share/cacti/rra/mailgraph.rrd":sent:AVERAGE \
DEF:b="/usr/share/cacti/rra/mailgraph.rrd":recv:AVERAGE \
CDEF:cdefa=a,60,* \
VDEF:cdefb=a,TOTAL \
CDEF:cdefe=b,60,* \
VDEF:cdeff=b,TOTAL \
AREA:cdefa#002A8F:"Sent"  \
GPRINT:cdefb:"    Total\:%8.0lf"  \
GPRINT:cdefa:AVERAGE:"Avg msgs/min\:%8.2lf %s"  \
GPRINT:cdefa:MAX:"Max msgs/min\:%8.0lf\n"  \
LINE2:cdefe#00BD27:"Received"  \
GPRINT:cdeff:"Total\:%8.0lf"  \
GPRINT:cdefe:AVERAGE:"Avg msgs/min\:%8.2lf %s"  \
GPRINT:cdefe:MAX:"Max msgs/min\:%8.0lf\n"

The "VDEF"s were able to be used by applying a patch found here:
That does away with a lot of the math involved in the original mailgraph.cgi rrdgraph calls, since that math was to get the totals from the RRA (and I think impossible to recreate in cacti, at least I could find no way to get the right time numbers for every graph automatically).

The reason I say "mostly" accurate, and the only problem I have, is with the "Max msgs/min" GPRINTs. In mailgraph.cgi, there are four DEFs; one for each dataset with the consolidation AVERAGE, and one each with MAX. The average ones are used for the graph lines, and the first two GPRINTs, while the MAX one is used only for the max msgs/min item.

Is there some way to get this data out of the RRA within Cacti? I was able to get it if I wanted to graph the data, but I couldn't seem to find a way to get it out for just printing the number (Cacti wants to just use the already retrieved dataset and use the MAX consolidation on the GPRINT, which gives the wrong value). As it is, it's telling me the max msgs/min over the average, but not the true max reported in the RRA.

Once I get this last bit figured out, I'll be uploading the templates and instructions for others who want to use Mailgraph's RRDs as external data sources too.


 Post subject:
PostPosted: Thu Mar 08, 2007 9:32 pm 

Joined: Fri Mar 02, 2007 8:44 pm
Posts: 19
Nobody? Mods, would this do better in the "Help: General" category maybe? I figured someone would've chimed in with either an answer, or a "can't happen" by now :P

(Not to say I'm ungrateful for the help I've received otherwise here - one of the more useful forums I've found in a long time)

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours

Who is online

Users browsing this forum: Google [Bot] and 7 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group