[rrd-users] Zero length var-string is converted to 0 instead of NaN

Fabian shony at nurfuerspam.de
Wed Oct 15 19:03:26 CEST 2008


Hello,

I'm using a small sh script to fill my rrd database. 
for better understanding I echoed out the values before they were stored.
looks like this
 6976,820,,,2304,224,41,31,19,21,570521878,45295299
 DEBUG stringlength: 4,3,0,0,4,3,2,2,2,2,9,8

You can see there are 2 values "missing". that's correct because they are not 
available for all data-source clients.

unfortunately rrdtool update won't convert these values to NaN instead it 
stores 0.000000+0. The Problem is, sometimes these values are really 0 
therefore setting min to 1 while creating the database won't help much.
 
Is it a bug or a feature?

For now I'm checking the length of the variables I'm going to store and set 
0-length ones manually to "NAN"

6976,820,NAN,NAN,2304,224,41,31,19,21,570521878,45295299
4,3,3,3,4,3,2,2,2,2,9,8
my new NAN values are accepted by rrdtool update and stored as NaN in the 
database.

I don't think this is the professional way, or is it?
thanks in advance for any help or suggestions



More information about the rrd-users mailing list