[rrd-users] display a value only if it fits into the current scale

Karl Fischer rrd-users at ficos.de
Fri Jul 4 13:43:45 CEST 2008


Hi,

I'm using rrdtool 1.23 and I'd like to display a value as LINE1 *only*
if it fits into the current scale without affecting the scale (pretty
much like HRULE, however, the value is going to be calculated and may
change over time, so I can't use HRULE ...

Therefor I need to know, what my current (y) scale is, so I tried to
use MAXIMUM as a workaround, but that doesn't work since VDEF variables
cannot be used in CDEF as it seems ... :-(

theoretical idea to display a warning line at 90% of max cap only if
the used cap gets any near the 90% limit (so the warning line itself
doesn't affect the scale):

DEF:maxcap=some.rrd:maxcapacity:LAST
DEF:usedcap=some.rrd:usedcapacity:LAST
CDEF:warnlimit=maxcap,0.9,*
CDEF:help=warnlimit,0.9,*
VDEF:usedmax=usedcap,MAXIMUM
CDEF:warnline=usedmax,help,GT,warnlimit,UKNN,IF  # this doesn't work
AREA:usedcap#0000ff:used capacity
LINE1:warnline#ff0000:90% full


this works, but it doesn't reflect changes in maxcap over time

DEF:maxcap=some.rrd:maxcapacity:LAST
DEF:usedcap=some.rrd:usedcapacity:LAST
CDEF:warnlimit=maxcap,0.9,*
VDEF:warnline=warnlimit,MAXIMUM
AREA:usedcap#0000ff:used capacity
HRULE:warnline#ff0000:90% full


any idea of how to achieve this?

many thanks

- Karl



More information about the rrd-users mailing list