# here is how I created the graphs.. # the rrd database goes like this #-Create the database called oww.rrd #where # a=temperature is a guage update interval 600 seconds # b=wind speed is a guage # c=wind direction is a guage # d=barometer is a guage ( and not yet built let alone logging ) # ------------------The rrd database ---------------------------------- rrdtool create oww.rrd --start 978300900 \ DS:a:GAUGE:600:U:U \ DS:b:GAUGE:600:U:U \ DS:c:GAUGE:600:U:U \ DS:d:GAUGE:600:U:U \ RRA:MIN:0.5:1:600 \ RRA:MIN:0.5:6:700 \ RRA:MIN:0.5:24:775 \ RRA:MIN:0.5:288:797 \ RRA:AVERAGE:0.5:1:600 \ RRA:AVERAGE:0.5:6:700 \ RRA:AVERAGE:0.5:24:775 \ RRA:AVERAGE:0.5:288:797 \ RRA:MAX:0.5:1:600 \ RRA:MAX:0.5:6:700 \ RRA:MAX:0.5:24:775 \ RRA:MAX:0.5:288:797 # I still don't confess to understanding fully yet # but it has been logging for a few days now and seems to be OK # ----------------------------End of my rrd database --------------------- # I call the following script from my crontab every minute # ---------------Start of makegraph script ------------------------------- tail -1 logfile.log > /home/rob/public_html/logfile # this just copies the last ( most recent ) line of the OWW log # to a convenient place to be used later on # now to the first 4 graphs - 24 Hrs for temp wind speed and dir and the # as yet ficticious barometer rrdtool graph public_html/temp5min.gif --start -90000 \ --vertical-label Degrees_C \ DEF:linea=oww.rrd:a:AVERAGE LINE2:linea#FF0000:"TEMPERATURE" \ HRULE:0#00AA00:'Freezing Point (0C)' rrdtool graph public_html/speed5min.gif --start -90000 \ --vertical-label MPH \ DEF:lineb=oww.rrd:b:AVERAGE \ LINE2:lineb#00FF00:"WIND SPEED" rrdtool graph public_html/dir5min.gif --start -90000 \ --alt-autoscale-max -u 360 -r -v "N E S W N" \ DEF:linec=oww.rrd:c:AVERAGE LINE2:linec#0000FF:"WIND DIRECTION" # 7 day graphs all round rrdtool graph public_html/weeklytemp.gif -s -604800 \ DEF:linea=oww.rrd:a:AVERAGE LINE3:linea#FF0000:"This Week TEMPERATURE" \ rrdtool graph public_html/weeklywind.gif --start -604800 \ --vertical-label MPH \ DEF:lineb=oww.rrd:b:AVERAGE \ LINE3:lineb#00FF00:"This Week WIND SPEED" rrdtool graph public_html/weeklydir.gif --start -604800 \ --alt-autoscale-max -u 360 -r -v "N E S W N" \ DEF:linec=oww.rrd:c:AVERAGE LINE3:linec#0000FF:"This Weeks WIND DIRECTION" # this months graph for all data rrdtool graph public_html/monthlytemp.gif --start -3170880 \ DEF:linea=oww.rrd:a:AVERAGE LINE3:linea#FF0000:"This Months TEMPERATURE" \ rrdtool graph public_html/monthlywind.gif --start -3170880 \ --vertical-label MPH \ DEF:lineb=oww.rrd:b:AVERAGE \ LINE3:lineb#00FF00:"This Months WIND SPEED" rrdtool graph public_html/monthlydir.gif --start -3170880 \ --alt-autoscale-max -u 360 -r -v "N E S W N" \ DEF:linec=oww.rrd:c:AVERAGE LINE3:linec#0000FF:"This Months WIND DIRECTION" cat refresh > /home/rob/public_html/index.html cat /home/rob/public_html/logfile >> /home/rob/public_html/index.html cat /home/rob/public_html/weather.php >> /home/rob/public_html/index.html # -------------------this is the end of the makegraph executable--------- # The above 3 lines add a refresh tag to the head of the index page # ( refreshes every minute ) # then inserts the last line of data from OWW into the top of the web page # adds the following graphing page into the index page #--------------------- Start Of Webpage ( weather.php )------------------
Todays Graphs
Weekly Graph
This Month