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

Karl Fischer rrd-users at ficos.de
Fri Jul 4 20:40:40 CEST 2008


Alex van den Bogaerdt wrote:
> On Fri, Jul 04, 2008 at 01:43:45PM +0200, Karl Fischer wrote:
> 
>> 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


Thanks Alex for looking into it ...

unfortunately it doesn't quite what I want and I'm still failing to tweak
it that way ...
In your example there's a line at 45, but it should be at 90 (so outside
of the visible area, since the biggest value for use is 47 ...
(pretty similar to what HRULE:90 would do ...)

to stick with your (slighly modified) example of:

E=$S
E=$((E+60));rrdtool update test.rrd $E:50:44
E=$((E+60));rrdtool update test.rrd $E:50:45
E=$((E+60));rrdtool update test.rrd $E:50:46
E=$((E+60));rrdtool update test.rrd $E:100:47
E=$((E+60));rrdtool update test.rrd $E:100:40

up to t=$S + 180 I would like to have a line at 45 (90% of max which is 50)
and then I would like to have the warnline at 90 (90% of max) but this part
sould be invisible (outside of the graphing area) unless the 'use' value gets
any near the limit (90% of warn)

In other words: it doesn't make sense to expand the scale to 90 just to be
able to show the warning line of '90% full' if the current usage is way below.

Show the user the warning line if he get's near to 90% of his filesystem size.
(dependend on the current filesystem size)

So I need to find the max value for 'use' in the current timerange and display
the warn-line only if 'maxuse > 90% of warn' ...

I'm trying to change the example accordingly and repost ...


> What is version 1.23 and does it know VDEF ?

I'm sorry, should have been RRDtool 1.2.23


- Karl



More information about the rrd-users mailing list