[rrd-users] Temperature Monitoring

Simon Hobson linux at thehobsons.co.uk
Thu Feb 16 18:48:43 CET 2012

Steve Shipway wrote:
>I would advise you to store a and b separately.
>You can always use a CDEF in your rrdtool 
>function to generate a new value c=a-b and then 
>average or max this, if you so choose.

If you need max(a-b) then you need to store a-b.

Lets say the house is 20š all the time, and 
outside varies from freezing (0š) to balmy (20š) 
during a day - a bit extreme I know (at least for 
the UK), but it makes the point. We'll have 
step=300, and consolidate down to various periods 
- including 24 hours per CDP.

Early morning, outside (o) reaches minimum of 0š, 
inside (i) is 20š, i-o=20. Late afternoon, O=20 
and i-o=0.
So during the day, max(i=o)=20.

Now, we only store i and o, with average and 
maximum consolidations. Over a 24 hour period, 
max(i)=20, and max(o)=20, so max(i)-max(o)=0.
We need to have stored (i-o), and consolidated it 
with max function - then we'll find that 

Same if we want min(i-o).

Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.

More information about the rrd-users mailing list