CDEF 0 in rrdtool graph

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

CDEF 0 in rrdtool graph

Olivier Doucet-4
Hello,

It seems "CDEF:mydefinition=0" is not handled correctly and gives this error :
ERROR: don't undestand '0'

This expression is present in documentation though : https://oss.oetiker.ch/rrdtool/tut/cdeftutorial.en.html

I'm using RRDtool 1.5.3

Is this a bug in software ? In documentation ? 

Olivier


_______________________________________________
rrd-users mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
Reply | Threaded
Open this post in threaded view
|

Re: CDEF 0 in rrdtool graph

SolarMan
Hello Olivier,
The error message is confusing and should actually read:
rrdtool.OperationalError: rpn expressions without DEF or CDEF variables are not supported
as it does in other cases.
The meaning is clear: you must use a DEF or CDEF in your CDEF definition.
Regards,
hans
Reply | Threaded
Open this post in threaded view
|

Re: CDEF 0 in rrdtool graph

Olivier Doucet-4
Hi,


2017-02-14 19:44 GMT+01:00 SolarMan <[hidden email]>:
Hello Olivier,
The error message is confusing and should actually read:
rrdtool.OperationalError: rpn expressions without DEF or CDEF variables are
not supported
as it does in other cases.
The meaning is clear: you must use a DEF or CDEF in your CDEF definition.
Regards,
hans

Thank you Hans for your quick response. I understand the documentation is wrong then.

Any idea how to easily create a DEF with 0 value all along ? I'm using it in a automatized script that write the whole 'rrdtool graph' line, and when original DEF file is not present, I would like to replace it with 0 to keep the same logic.

Olivier



_______________________________________________
rrd-users mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
Reply | Threaded
Open this post in threaded view
|

Re: CDEF 0 in rrdtool graph

Jacques du Toit
Hi Oliver

I’m afraid you’ll always need a DEF from somewhere. I’ve done plenty of workarounds like this, including having an empty rrdfile that is never updated. Usually I end up doing something like this to get just a 0 value...

DEF:foo=/some/empty/rrdfile.rrd:foo:AVERAGE
CDEF:myval=foo,POP,0

Hope that helps :)

Cheers,
  Jacques

On 14 Feb 2017, at 20:49, Olivier Doucet <[hidden email]> wrote:

Hi,


2017-02-14 19:44 GMT+01:00 SolarMan <[hidden email]>:
Hello Olivier,
The error message is confusing and should actually read:
rrdtool.OperationalError: rpn expressions without DEF or CDEF variables are
not supported
as it does in other cases.
The meaning is clear: you must use a DEF or CDEF in your CDEF definition.
Regards,
hans

Thank you Hans for your quick response. I understand the documentation is wrong then.

Any idea how to easily create a DEF with 0 value all along ? I'm using it in a automatized script that write the whole 'rrdtool graph' line, and when original DEF file is not present, I would like to replace it with 0 to keep the same logic.

Olivier


_______________________________________________
rrd-users mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users


_______________________________________________
rrd-users mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users