[rrd-users] Counter values must be integer.

Dan Carroll danny at dannysplace.net
Wed Jan 11 09:50:27 CET 2017


Hello All,


Apologies if this has been covered before.   I did a lot of searching but found nothing recent.
I’m wanting to log rain data.   As such I get a get a value from my rain gauge that is a counter…   The problem is that it’s a small counter…   i.e. for the last few days it’s been sitting on 75.52 (millimetres).

Before I can update the RRD with the new values I need to convert it to an integer.   I’ve chosen to multiply by 100 to keep the resolution the same.

I came across the following post from 2007 identifying the same problem:

http://git.net/ml/db.rrdtool.devel/2007-07/msg00007.html <http://git.net/ml/db.rrdtool.devel/2007-07/msg00007.html>

Here’s the relevant info and reply from Tobi.

------------------------------------
> I noticed this when looking into a problem one of my Hobbit users
> reported today. It seems that when you define a DS as a COUNTER,
> then it will only accept updates with integer values - except for
> the first time:
>
> $ rrdtool create foo.rrd DS:virt:COUNTER:600:0:U RRA:AVERAGE:0.5:1:600
> $ rrdtool update foo.rrd N:10.5
> $ rrdtool update foo.rrd N:10.5
> ERROR: not a simple integer: '10.5'
>
> It kind of makes sense that a counter must be an integer, but why does
> the first update work ok ?

you are right ... the check in the code only kicked in when the
previous update was ! U ...

r1171 has the fix …
------------------------------------

I could not find any info about r1171 but it seems at some point it was rolled back because the exact same problem still exists.
i.e.  First entry works fine, second entry fails.

I wonder if anyone knows why this patch was rolled back or if there is a better way to do what I’m trying to do.

Thanks!

-Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.oetiker.ch/pipermail/rrd-users/attachments/20170111/607d5f18/attachment.html>


More information about the rrd-users mailing list