[rrd-users] How to get LAST, AVG, MAX data (that are in graph legend) in text/string format?

deele nils_k at inbox.lv
Thu Jan 20 11:52:17 CET 2011

Sorry for such a newbie question, but the thing is, I am using Cacti, and I
want to make automatic reports about traffic-type graphs, that include two
values from graphs - Inbound Max and Outbound Max. I just don't understand
how to get just those two values out of RRD. It would be easier for me, to
make OCR trace on graph image, to extract those numbers :D
/usr/local/bin/rrdtool graph - \
--imgformat=PNG \
--start=1292836870 \
--end=1295508070 \
--title='Example graph title' \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale \
COMMENT:"From 2010/12/20 11\:21\:10 To 2011/01/20 09\:21\:10\c" \
COMMENT:"  \n" \
--vertical-label='Bits per second' \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/usr/local/share/cacti/rra/inbound_data.rrd":snmp_oid:AVERAGE \
DEF:b="/usr/local/share/cacti/rra/outbound_data.rrd":snmp_oid:AVERAGE \
CDEF:cdefa=a,8,* \
CDEF:cdefe=b,8,* \
AREA:cdefa#7EE600FF:"IN"  \
GPRINT:cdefa:LAST:" Current\:%8.2lf %s"  \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s\n"  \
LINE1:cdefe#4668E4FF:"OUT"  \
GPRINT:cdefe:LAST:"Current\:%8.2lf %s"  \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s\n" 
Maybe, there is a way to do that with FETCH or something, but I need only
those values that are GPRINT in graph syntax above.
The last resort, as I understand, is to FETCH data from both RRD's, and
determine largest number for each of RRD's, compare them and output only
one, which is largest (needed for my report calculations).

PS: It would be great, if such a function could be pre-built in rrdtool
graph (reading actual data from image) and maybe, achieved using image
headers or EXIF (or other image/file info storage), reading both of them is
View this message in context: http://rrd-mailinglists.937164.n2.nabble.com/How-to-get-LAST-AVG-MAX-data-that-are-in-graph-legend-in-text-string-format-tp5943307p5943307.html
Sent from the RRDtool Users Mailinglist mailing list archive at Nabble.com.

More information about the rrd-users mailing list