Hi all,<br><br>I'm currently graphing daily, weekly, monthly and yearly inside and outside temperatures. The temperature values are fetched from SQL database and then put into temperatures.rrd. I have a cron job that runs this every 5 minutes. Then I wanted to graph average temperatures too. I didn't think of any other way but to read average temps from
temperatures.rrd and them into a new rrd, averages.rrd. Then I graph averages.rrd as usual. Can anyone think of a better way to do this? I suppose average data could be in the same temperatures.rrd but that's irrelevant at the moment.
<br><br>temperatures.rrd:<br><br>rrdtool create /var/digitemp/temperature.rrd <br>DS:out:GAUGE:600:-50:50 <br>DS:in:GAUGE:600:-50:50 <br>RRA:AVERAGE:0.5:1:600 <br>RRA:AVERAGE:0.5:6:700 <br>RRA:AVERAGE:0.5:24:775 <br>RRA:AVERAGE:
0.5:288:797 <br>RRA:MIN:0.5:1:600 RRA:MIN:0.5:6:700 <br>RRA:MIN:0.5:24:775 RRA:MIN:0.5:288:797 <br>RRA:MAX:0.5:1:600 RRA:MAX:0.5:6:700 <br>RRA:MAX:0.5:24:775 RRA:MAX:0.5:288:797<br><br>averages.rrd:<br><br>rrdtool create /var/digitemp/averages.rrd \
<br> DS:dayout:GAUGE:600:-50:50 \<br> DS:dayin:GAUGE:600:-50:50 \<br> DS:weekout:GAUGE:600:-50:50 \<br> DS:weekin:GAUGE:600:-50:50 \<br> DS:mnthout:GAUGE:600:-50:50 \<br> DS:mnthin:GAUGE:600:-50:50 \
<br> DS:yearout:GAUGE:600:-50:50 \<br> DS:yearin:GAUGE:600:-50:50 \<br> RRA:AVERAGE:0.5:1:600 \<br> RRA:AVERAGE:0.5:6:700 \<br> RRA:AVERAGE:0.5:24:775 \<br> RRA:AVERAGE:0.5:288:797 \
<br> RRA:MIN:0.5:1:600 \<br> RRA:MIN:0.5:6:700 \<br> RRA:MIN:0.5:24:775 \<br> RRA:MIN:0.5:288:797 \<br> RRA:MAX:0.5:1:600 \<br> RRA:MAX:0.5:6:700 \<br> RRA:MAX:0.5:24:775 \
<br> RRA:MAX:0.5:288:797<br><br>script:<br><br>rrdtool update /var/digitemp/temperatures.rrd N:$out:... etc.<br><br>dayout=`rrdtool graph /etc/digitemp/foo DEF:Out=/var/digitemp/temperature.rrd:out:AVERAGE VDEF:gav=Out,AVERAGE PRINT:gav:"%5.2lf" -s -1day | tail -n1 | awk '{print $1}'`
<br><br>etc...<br><br>rrdtool update /var/digitemp/averages.rrd N:$dayout:... etc.<br><br>(graphing...)<br><br>Problem is, at exactly 9:15 in the morning, this script stops updating the averages.rrd (all values are "nan") and starts again at 5:15 in the afternoon. I have no idea why. Any ideas are appreciated.
<br><br>cheers,<br><br>Petteri Matilainen<br>