The stuff I'm about to mention is for graphing HW enabled rrd's,
I personally use external scripts to create and update rrd's, so I haven't messed with having Cacti actually create them.
First off you will need to edit include/global_arrays.php and add in 3 new CF's.
It should look like this:
Code: Select all
$consolidation_functions = array(1 =>
"AVERAGE",
"MIN",
"MAX",
"LAST",
"HWPREDICT",
"DEVPREDICT",
"FAILURES",
);
The CDEF's you will need are:
Upper bounds: cdef=b,c,2,*,+
Lower bounds: cdef=b,c,2,*,-
Ticks: cdef=CURRENT_DATA_SOURCE TICK:CURRENT_DATA_SOURCE#ffffa0:1.0:"Failures\n"
Things to note here are, I have hardcoded the math in the bounds to use DEF's b and c, which in my case are HWPREDICT and DEVPREDICT respectively. Your setup could be different if you have more than one DS in your rrd, for instance for network traffic you have an in DS and an out DS. You will need to create Upper_In/Lower_In and Upper_Out/Lower_Out in that case and put the correct DEF letters inplace for the CDEFs.
The Ticks CDEF uses the graph injection hack that Jasper figured out, this could be removed in future versions of Cacti since it technically is a vulnerability though I don't think it's that severe of one.
Here's some debugging output from the graph so you can see what's going on:
Code: Select all
DEF:a="my.rrd":bps:AVERAGE \
DEF:b="my.rrd":bps:HWPREDICT \
DEF:c="my.rrd":bps:DEVPREDICT \
DEF:d="my.rrd":bps:FAILURES \
CDEF:cdefc=b,c,2,*,+ \
CDEF:cdefd=b,c,2,*,- \
CDEF:cdefe=d TICK:d#ffffa0:1.0:"Failures\n" \
AREA:a#000000FF:"\n" \
LINE3:b#FFF200B2:"" \
LINE2:cdefc#FF0000B2:"" \
LINE2:cdefd#FF0000B2:"" \
\
LINE1:d:""
After I have that, I made a comment, with the CF set to FAILURES and the CDEF set to Tick.
That will set CURRENT_DATA_SOURCE to equal DEF d and the tick will be graphed.
Currently the ticks are plotting correctly for me, I have graphs generated both within Cacti and externally and so far they match. I have a situation right now that puts my graphs in a failure state, so I need to wait til I recover from that state to see if the failure ticks stop when I no longer violate my confidence bands.
Let me know if you guys need some more info, I have posted stuff on how I did my confidence bands here:
http://forums.cacti.net/viewtopic.php?t ... t&start=30
When I get a chance I'll dump my graph templates and post them.