[rrd-users] Line Colour Based on Value

Chris Mason chris at netnix.org
Sat Mar 2 12:20:42 CET 2013


Hi,

I think I know the answer to this question, but before I go down this
route I wanted to check there wasn't an easier alternative.
I am plotting two data sources on a graph:

DEF:DS1=<rrdfile>:DS1:MAX
DEF:DS2=<rrdfile>:DS2:MAX

LINE1:DS1#00CC00:'DS1\\l'
COMMENT:'\\u'
GPRINT:DS1:MAX:'%5.1lf w\\g'
COMMENT:'\\r'

LINE1:DS2#00CC00:'DS2\\l'
COMMENT:'\\u'
GPRINT:DS2:MAX:'%5.1lf w\\g'
COMMENT:'\\r'

I want to change the colour of the line depending on the MAX value -
if it is over a certain value I want a red line, but if it is below I
want a green line.
I am assuming I need to call rrdtool twice and fetch the MAX value and
then use that in my script to determine the colour?

Is this a way to achieve this without a double pass?

Thanks,
Chris



More information about the rrd-users mailing list