Discussion:
[rrd-users] Inserted value becomes NaN
(too old to reply)
Jon August
2015-01-15 16:02:20 UTC
Permalink
I created an RRD file with this:
rrdtool create filename.rrd \
--step '86400' \
--start '1388534400' \
'DS:devices:GAUGE:172800:U:U' \
'RRA:AVERAGE:0.5:1:365'
I want to store the number of devices on a network daily.

When I try to do an update, the RRA dump shows NaN. As if the value was ignored. I do an update like this:

rrdtool updatev filename.rrd N:1102

What am I doing wrong?

Thanks,
-Jon
Simon Hobson
2015-01-15 17:12:45 UTC
Permalink
Post by Jon August
rrdtool updatev filename.rrd N:1102
What am I doing wrong?
One update does not create a value in the database - it merely sets a "known point", and for the very first update, all data up to that point is unknown. You need to make repeated updates over a period of time. Once you pass the *END* of a data point, then a value will be computed for the previous interval - but only if enough data has been entered for the interval to have a valid value, that's what the "fudge factor" (0.5 in your example) is for.

So in your case, you need multiple updates, not more than 48 hours apart (or the data becomes unknown again), and after the end of a day* you will get a value if you have enough data to fill the previous 12 hours (0.5 x 1day) with valid data.

* Note that a day will start/end at midnight UTC. All intervals end at an integer multiple of "step" after midnight Jan 1 1970 (unix epoch).
Jon August
2015-01-16 21:36:32 UTC
Permalink
Got it.

Thanks for the clarification.

-Jon
Post by Simon Hobson
Post by Jon August
rrdtool updatev filename.rrd N:1102
What am I doing wrong?
One update does not create a value in the database - it merely sets a "known point", and for the very first update, all data up to that point is unknown. You need to make repeated updates over a period of time. Once you pass the *END* of a data point, then a value will be computed for the previous interval - but only if enough data has been entered for the interval to have a valid value, that's what the "fudge factor" (0.5 in your example) is for.
So in your case, you need multiple updates, not more than 48 hours apart (or the data becomes unknown again), and after the end of a day* you will get a value if you have enough data to fill the previous 12 hours (0.5 x 1day) with valid data.
* Note that a day will start/end at midnight UTC. All intervals end at an integer multiple of "step" after midnight Jan 1 1970 (unix epoch).
_______________________________________________
rrd-users mailing list
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
Loading...