[rrd-users] Re: threshold graph in rrdtool.

Andrew Culver aculver at uwo.ca
Fri Aug 8 17:14:20 MEST 2003

See replies below..

----- Original Message ----- 
From: "Young, Jeff" <Jeff.Young at DRKW.COM>
To: <rrd-users at list.ee.ethz.ch>
Sent: Friday, August 08, 2003 10:55 AM
Subject: [rrd-users] threshold graph in rrdtool.

> I've been using rrdtool for a while to graph TX and RX MB/s via all ports
> brocade fibre switches.  I have recently added a feature where the user
> specify a threshold value.  The idea is that all values below this given
> value will be ignored in the graph.  So if we want to see all ports
> over 45 MB/s I set a threshold of 47185920.
> In detail I am simply reducing to zero any values that fall below this
> threshold. ie
> HRULE:$threshold#22FF22:Threshold"
> DEF:PRE$attribCounter=$fileName:$attrib:AVERAGE
> bCounter$formula,IF
> This gives a reasonable result but there are a few aspects that still bug
> me.
> 1) Below the threshold I still see the graphing lines.  They are the
> vertical lines that join the last 'zero' value of the data to the first
> 'above threshold' value of data.  I would like a way of not drawing this
> part of the line.  I could do it by defining two CDEFs and drawing the
> section in white ( background ) and the over section in line_colour.  This
> is the way i'll go if no one has a better idea.

Instead of turning the small values to 0, turn them to UNKN. This will
prevent anything to do with that line from being drawn during the times
where it is above the threshold. It will simply appear as a gap in the data,
or if the entire line would be below the threshold, it will draw not draw
anything for that line.

> Is it possible to do something with the vertical axis so I effectively
> down the 40Mb line to where the 0Mb line was ? This way I miss out all the
> un-interesting bit and get a nice graph that starts at my given threshold
> value.

Use --lower-limit 40 (or whatever) in your graph command. However, this will
fix it to some value. I think you'll find, that once you change the
below-threshold values to UNKN, the graph will automatically shift the scale
to fit the visible data to the whole graphing area. Try leaving this out at
first. If it doesn't do it automatically, then add it.

> 2) I also build up a legend under the graph
> LINE2:BYTES$attribCounter#$colours[$colour]:@anno ($unit)$fill
> GPRINT:BYTES$attribCounter:MAX:%6.2lf%s
> GPRINT:BYTES$attribCounter:MIN:%6.2lf%s
> GPRINT:BYTES$attribCounter:AVERAGE:%6.2lf%s\\n
> I need a way of NOT adding legend lines for those line that fall below the
> given threshold. ie if BYTES$attribCounter:MAX < threshold then miss out
> this GPRINT.

I don't know of any built-in way to do this. All I can suggest is using perl
(or your language of choice) to manually fetch the data for the time period
and check to see if it is above the treshold. If it is, then add the legend
in your graph command. If not, don't include it. This is a kind of messy
kludge though. Perhaps someone else will have a better idea.

Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

More information about the rrd-users mailing list