After reading the documentation about the COMPUTE DS, I think that it will be a welcome addition to Cacti and it will be quite useful, but there are a few areas where customer CDEF would be more useful.
1. It is not 100% obvious in the man pages, but it appears that the COMPUTE needs to be added to the RRD when it is created. This is fine when you are aware of your requirements before you start your collecting the data but it is not helpful if you want to add information to graphs wityh already existing data.
If you can add to the existing graph data, you will have to have an interface that allows for updating the RRD files with the COMPUTE values that you want to include.
By allowing for the creation of CDEFs directly in the Graph Template, you gain all of the flexibility of the COMPUTE DS, at least when it comes to drawing the graphs themselves, without having to make any preparations ahead of time.
2. In the current age of ginormous Hard Drives for no $$$, this issue is less likly to apply, but the COMPUTE DS is stored in the RRD file and will make all of the files larger and consume more drive space. This is not much of an issue with the default RRA configurations, but it is more of an issue for installations that have modified the default configuration and increased the number of non-consolidated data sources.
3. The COMPUTE data source is can only be applied to other Data Sources in the same graph. It does not have the ability to make comparisons or calculations across multiple RRD files or to other CDEFS already defined.
Here is a graph (along with RRDTOOL output) that I created that makes use of a CDEF that compares other CDEFs in the file. It is a graph of the total throughput that overlays the color red on top of the graph whenever the utilization exceeds 40%.
First the RRD output:
Code: Select all
/usr/local/rrdtool-1.2.28/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="xxxxxxx - Outbound Traffic" \
--base=1000 \
--height=300 \
--width=700 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="Bits per Second" \
--slope-mode \
--font TITLE:12:/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf \
--font AXIS:8:/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf \
--font LEGEND:8:/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf \
--font UNIT:8:/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf \
DEF:a="/usr/local/cacti/rra/xxxxxxx_maxoutbound_1982.rrd":maxoutbound:AVERAGE \
DEF:b="/usr/local/cacti/rra/xxxxxxx_idletraffic_1981.rrd":idletraffic:AVERAGE \
DEF:c="/usr/local/cacti/rra/xxxxxxx_maxoutbound_1982.rrd":maxoutbound:MAX \
CDEF:cdefa=a,0,* \
CDEF:cdefb=a,b,-,a,/,100,* \
CDEF:cdefc=b,0,* \
CDEF:cdefg=a,b,- \
CDEF:cdefbc=cdefb,50,GT,cdefb,100,GT,UNKN,cdefg,IF,UNKN,IF \
LINE1:cdefa#000000FF:"" \
COMMENT:" " \
LINE1:cdefc#000000FF:"" \
COMMENT:" \n" \
GPRINT:a:LAST:"Max Outbound\:%8.2lf %sbps\n" \
COMMENT:" \n" \
LINE1:cdefg#009485FF:"" \
AREA:cdefg#00948533:"Outbound Traffic\:" \
GPRINT:cdefg:LAST:"Current\:%8.2lf %s" \
GPRINT:cdefg:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefg:MAX:"Maximum\:%8.2lf %s\n" \
COMMENT:" \n" \
AREA:cdefbc#FF00007F:"Alarm State > 80% Utilization\n" \
COMMENT:" \n" \
COMMENT:"Last Updated\: Fri 02 Jan 12\:55\:16 CST 2009\n"
CDEFB in the output above had to be added to a comment inserted into the second line of the graph items and CDEFBC had to be created assuming the CDEF naming in Cacti was consistant and the Comment was located in the same position.
With the above proposal, I would define the 2 CDEFs manually in the graph with custom names that I had assigned, then I would create the "Alarm State" Area Graph Item and apply the CDEF that was already created by name.