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

Karl Fischer rrd-users at ficos.de
Wed Oct 15 19:22:58 CEST 2008


Fabian wrote:
> 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

Fabian,

the rrdupdate manpage clearly says:

"... The remaining elements of the argument are DS updates. The order of this
list is the same as the order the data sources were defined in the RRA.
If there is no data for a certain data-source, the letter U (e.g., N:0.1:U:1)
can be specified."

hth

- Karl



More information about the rrd-users mailing list