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

Karl Fischer rrd-users at ficos.de
Sun Jul 6 18:26:18 CEST 2008


Alex van den Bogaerdt wrote:
> 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.

I guess you're right - my understanding was different:
I thougt that a CDEF is a function that get's executed on every DP,
rather than an array along the time scale ...
At least that clarifies the difference and helps (me) understanding.


> 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.

you're right again - nothing to add ...


>> 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?

haven't seen that - using oldds,POP seems to be the shortest solution.


>>>> 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.

still don't quite agree here ...
If I have a VDEF:max=someds,MAXIMUM it may be treated as a constant
*from now on*, however, how should I replace 'max' by some constant
in the the rrdgraph-definition? I don't know what the max value will
be over the given time range.


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

it looks like it all comes back to this ...

Many thanks for the clarification - I helps me understand the
internals of rrdgraph much better ...


Rgds
- Karl



More information about the rrd-users mailing list