[rrd-users] Measuring rain from weatherstation

Alex van den Bogaerdt alex at vandenbogaerdt.nl
Mon Dec 8 11:38:11 CET 2014


> So we end up with :
>
> forever
>  read value
>  if value > min
>    reset counter
>    reset timer
>    write T:value to rrd
>    writeT+1:0 to rrd
>  else
>    if timer > some_period
>    write T:0 to rrd
>    reset timer
>  sleep for a bit
> go back and do it all again

Not quite.  I think you are mixing two different solutions.

Option 1: don't reset the counter every time it is read. The counter will 
reset itself just after midnight.  In this case use DERIVE and optionally do 
write that zero. Writing the zero is optional, it will help a bit in 
preventing an unknown at the beginning of each day.

Option 2: (if possible) reset the counter every time it changed. This means 
using ABSOLUTE as counter type. Write the appropriate amount to RRD. Do not 
write an extra zero to the rrd, this is already taken care of by using 
ABSOLUTE.

But yes, something does need to be done before the hearbeat timer expires, 
in both cases.



More information about the rrd-users mailing list