[rrd-users] CDEF / VDEF / PRINT / GRPRINT limitations & workarounds

Alex van den Bogaerdt alex at ergens.op.het.net
Sun Jul 6 13:53:18 CEST 2008


On Sun, Jul 06, 2008 at 01:11:26PM +0200, Karl Fischer wrote:
> Alex van den Bogaerdt wrote:
> > On Sun, Jul 06, 2008 at 12:08:03PM +0200, Karl Fischer wrote:
> > 
> >> over the last couple of days I kept constantly fooling myself with
> >> the current limitations of CDEF / VDEF / PRINT / GRPRINT ...
> >>
> >> * CDEF needs at least one vname from DEF or CDEF (not VDEF)
> > 
> > Correct, mostly.  You can use VDEF here, as long as the CDEF would
> > support a number.
> > 
> > E.g.:  CDEF:newds0=ds0,8,*
> > also:  CDEF:newds0=ds0,somevdef,*
> > where that vdef would result in 8
> 
> yeah, but the problem is more that *at least one* vname for CDEF
> needs to be from (C)DEF, so
> 
> CDEF:new=vdef1,vdef2,-

You are mixing problems here.

You do not seem to know what a CDEF actually is.  It is an array
of numbers, where the index is on the time scale. In your example,
there is no time component thus no array thus no CDEF.

What you want is RPN on a VDEF.  It isn't CDEF's fault that this
isn't working. If the problem is outside CDEF then so is the solution.

> doesn't work and has to be rewritten into something like
> 
> CDEF:new=someoldds,UN,vdef1,vdef1,IF,vdef2,-

CDEF:new=vdef1,vdef2,-,someoldds,POP
or
CDEF:new=someoldds,POP,vdef1,vdef2,-
or something like that.

a similar example exists in the tutorial I think?

> >> Since CDEF *can* work with vnames from VDEF, why does it want to
> >> have at least one (C)DEF vname? Could this be changed easily?
> > 
> > VDEF results in a number (a pair actually). Now see next answer.
> > 
> >> Why doesn't CDEF accept rpns without a (C)DEF vname?
> > 
> > Because that would mean it's a constant.
> 
> not quite true - it's a calculated constant, meaning:
> It doesn't vary over the time period show, but it isn't a constant

If it doesn't vary, it is constant.

> I needed it for the LINEx:optional thing you mentioned above.
> Use VDEF/MAXIMUM to find out about the current yscale and then use
> LIMIT to only show the line if it fit's the scale ...

"The line" -> DEF or CDEF. LIMIT will be in a CDEF, and that's where
you can use the VDEF instead of a hard coded number.

CDEF:resultingline=inputdata,0,100,LIMIT
LINE2:resultingline#0000FF

can also be

CDEF:resultingline=inputdata,cdef1,cdef2,LIMIT
LINE2:resultingline#0000FF

can also be

CDEF:resultingline=inputdata,vdef1,vdef2,LIMIT
LINE2:resultingline#0000FF

Again: if you have a problem doing RPN in VDEF, that doesn't mean
a problem exists in CDEF.

-- 
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/



More information about the rrd-users mailing list