I'm trying to graph the temperature in one of the nearest cities to me. I get the data via an uploaded file, which I download once pre hour. I parse it and get the temperature in gradus Celsius. At that point I could make a MRTG graph, that shows the temperature's change, but it wont show the negative numbers (it gets really cold out there, so it IS a problem
)
RRDtool is the solution for me. I've read the manual (well.. a big part of it ^_-) but can't get some things. I need a database which holds data.. ok. I need my data to be GAUGE and to be updated once per hour. So I did the following:
rrdtool create temperatura.rrd --start 1100864907 DS:temp:GAUGE:600:U:U RRA:AVERAGE:0.5:1:24
I'm updating the database via that (put in /etc/cron.hourly):
Code:
TEMP=`cat /root/weather/LBPD.TXT | grep emper | awk '{print $4}' | cut -d"(" -f2`
TIME=`date +%s`
rrdtool update /var/www/htdocs/rrd/temperatura.rrd $TIME:$TEMP
And finally, I'm drawing the graph via that:
rrdtool graph temp.gif DEF:mytemp=temperatura.rrd:temp:AVERAGE LINE2:mytemp#FF0000
I don't know if all these things are right. I want the graph to be colored in blue if the temperature drop below zero, and red if positive. And I'm not sure if that "RRA:AVERAGE:0.5:1:24" is right.. didn't succeed to catch the meaning in the manual.
Some help here?