Discussion:
[rrd-users] rrdtool 1.5 'don't understand' my previously working CDEF
(too old to reply)
Johan Ström
2016-02-02 16:44:33 UTC
Permalink
Hi,

I've been using rrdtool 1.4.x for years with a certain script, but I got
into some issues when FreeBSD introduced 1.5.5 (1.4.8 before).
Basically, I have some temperature data, in which I want to filter out
the exact value 85.00, and "render" an unkn/nan instead:

DEF:rawmax=myfile.rrd:value:MAX
CDEF:vmax=rawmax,85.00,EQ,NaN,rawmax,IF

Since the upgrade, rrdtool now fails with ERROR: don't understand
'NaN,rawmax,IF'
I've checked again and again, but I fail to see any syntax errors or
other apparent issues. I've tried with UNKN instead of NaN and other
stuff, but no success..

If anyone could point me in the right direction I'd be very happy!

Thanks,
Johan
Tobias Oetiker
2016-02-02 22:16:17 UTC
Permalink
HI Johan,

what error do you get when you use UNKN ... NaN is not a legal
statement in rrdtool

the rpn parser has become much more unforgiving in 1.5

cheers
tobi
Hi,
I've been using rrdtool 1.4.x for years with a certain script, but I got into
some issues when FreeBSD introduced 1.5.5 (1.4.8 before).
Basically, I have some temperature data, in which I want to filter out the
DEF:rawmax=myfile.rrd:value:MAX
CDEF:vmax=rawmax,85.00,EQ,NaN,rawmax,IF
Since the upgrade, rrdtool now fails with ERROR: don't understand
'NaN,rawmax,IF'
I've checked again and again, but I fail to see any syntax errors or other
apparent issues. I've tried with UNKN instead of NaN and other stuff, but no
success..
If anyone could point me in the right direction I'd be very happy!
Thanks,
Johan
_______________________________________________
rrd-users mailing list
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
--
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
www.oetiker.ch ***@oetiker.ch +41 62 775 9902
Steve Shipway
2016-02-02 22:35:09 UTC
Permalink
Post by Johan Ström
DEF:rawmax=myfile.rrd:value:MAX
CDEF:vmax=rawmax,85.00,EQ,NaN,rawmax,IF
'NaN' is not a valid RPN symbol in RRDTool. You should use UNKN instead.
Also watch out for typos like embedded spaces or doubled commas.

CDEF:vmax=rawmax,85,EQ,UNKN,rawmax,IF

This will convert 85 into unknown. However, with this value potentially
being a non-integer, due to Data Normalisation, the test may never return
true (as 85.00001 is not equal to 85). Maybe instead try...

CDEF:vmax=rawmax,85,GE,rawmax,86,LT,AND,UNKN,rawmax,IF

Though, I'm not sure what you're trying to achieve by only excluding value
85.

Steve

Steve Shipway
T: +64 9 3737 599 ext 86487
E: ***@auckland.ac.nz
Johan Ström
2016-02-03 18:59:04 UTC
Permalink
Post by Steve Shipway
Post by Johan Ström
DEF:rawmax=myfile.rrd:value:MAX
CDEF:vmax=rawmax,85.00,EQ,NaN,rawmax,IF
'NaN' is not a valid RPN symbol in RRDTool. You should use UNKN instead.
Also watch out for typos like embedded spaces or doubled commas.
Tobi, Steve,

thanks for help! I tried replacing NaN with UNKN in one failing location
now, and that worked.
I *did* try that the other day, but in another location. And this
location still has an issue, even with UNKN. But this seems to be
related to the use of "-" in the var names:

DEF:rawmaxout-north-air=file.rrd:value:MAX
CDEF:vmaxout-north-air=rawmaxout-north-air,85.00,EQ,UNKN,rawmaxout-north-air,IF

ERROR: don't understand 'rawmaxout-north,85.00,EQ,UNKN,rawmaxout-north,IF'

By replacing - with _, it now works great. However, I expected "-" to be
a valid variable?

"Variable names (/vname/) must be made up strings of the following
characters|A-Z, a-z, 0-9, -,_|and a maximum length of 255 characters."
http://oss.oetiker.ch/rrdtool/doc/rrdgraph_data.en.html
Post by Steve Shipway
CDEF:vmax=rawmax,85,EQ,UNKN,rawmax,IF
This will convert 85 into unknown. However, with this value potentially
being a non-integer, due to Data Normalisation, the test may never return
true (as 85.00001 is not equal to 85). Maybe instead try...
CDEF:vmax=rawmax,85,GE,rawmax,86,LT,AND,UNKN,rawmax,IF
Though, I'm not sure what you're trying to achieve by only excluding value
85.
Hm, so even if I store exactly 85 (in a gauge), data normalization may
turn this into something else?

The value 85.00 is used in my source device (1-Wire temp sensors) to
indicate a read failure. I actually think I filter out this nowadays,
this script has some legacy... so may not even be required here come to
think about it!

Well, my current issue is resolved, may look into the above potential
issue too.

Thanks!
Tobias Oetiker
2016-02-08 12:55:45 UTC
Permalink
Post by Johan Ström
Post by Steve Shipway
Post by Johan Ström
DEF:rawmax=myfile.rrd:value:MAX
CDEF:vmax=rawmax,85.00,EQ,NaN,rawmax,IF
'NaN' is not a valid RPN symbol in RRDTool. You should use UNKN instead.
Also watch out for typos like embedded spaces or doubled commas.
Tobi, Steve,
thanks for help! I tried replacing NaN with UNKN in one failing location now,
and that worked.
I *did* try that the other day, but in another location. And this location
still has an issue, even with UNKN. But this seems to be related to the use of
DEF:rawmaxout-north-air=file.rrd:value:MAX
CDEF:vmaxout-north-air=rawmaxout-north-air,85.00,EQ,UNKN,rawmaxout-north-air,IF
ERROR: don't understand 'rawmaxout-north,85.00,EQ,UNKN,rawmaxout-north,IF'
By replacing - with _, it now works great. However, I expected "-" to be a
valid variable?
"Variable names (/vname/) must be made up strings of the following
characters|A-Z, a-z, 0-9, -,_|and a maximum length of 255 characters."
http://oss.oetiker.ch/rrdtool/doc/rrdgraph_data.en.html
in that case the documentation needs to be fixed I guess ... :)
Post by Johan Ström
Post by Steve Shipway
CDEF:vmax=rawmax,85,EQ,UNKN,rawmax,IF
This will convert 85 into unknown. However, with this value potentially
being a non-integer, due to Data Normalisation, the test may never return
true (as 85.00001 is not equal to 85). Maybe instead try...
CDEF:vmax=rawmax,85,GE,rawmax,86,LT,AND,UNKN,rawmax,IF
Though, I'm not sure what you're trying to achieve by only excluding value
85.
Hm, so even if I store exactly 85 (in a gauge), data normalization may turn
this into something else?
The value 85.00 is used in my source device (1-Wire temp sensors) to indicate
a read failure. I actually think I filter out this nowadays, this script has
some legacy... so may not even be required here come to think about it!
Well, my current issue is resolved, may look into the above potential issue
too.
Thanks!
--
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
www.oetiker.ch ***@oetiker.ch +41 62 775 9902
Loading...