[rrd-users] simple [?] question

John Bramlett j.bramlett at gmail.com
Thu Feb 7 04:00:18 CET 2008

I need some help formulating a command to extract some data from rrd
files created by cacti.  All I want returned is a single number
representing 95th percentile for an arbitrary time period (no
graphical output; text only).

I'm not as clueless as this question is but rrdtool is kind of tough
since I just need this one thing I was hoping someone could help out
with a general form for a command.

Below is the command that cacti is using to generate the same number
that I'm looking for.  (The constant string "13.42 mb/s" in the last
COMMENT line is what I'm interested in retrieving, but don't know how
cacti gets to that.)

Thanks in advance for any help whatsoever.

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="sw135s3 - Traffic - Fa0/24" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bits per second" \
--slope-mode \
DEF:a="/usr/share/cacti/site/rra/sw135s3_traffic_in_31.rrd":traffic_in:AVERAGE \
CDEF:cdefa=a,8,* \
CDEF:cdefe=b,8,* \
AREA:cdefa#00CF00:"Inbound"  \
GPRINT:cdefa:LAST:" Current\:%8.2lf %s"  \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s\n"  \
LINE1:cdefe#002A97:"Outbound"  \
GPRINT:cdefe:LAST:"Current\:%8.2lf %s"  \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s\n"  \
COMMENT:"\n"  \
HRULE:13415950.96#FF0000:"95%"  \
COMMENT:"13.42 mb/s\n"

More information about the rrd-users mailing list