[mrtg] a lightweight temperature example?

paul beard paulbeard at mac.com
Mon Jan 28 20:24:22 MET 2002


you could use mrtg for this: I'm using rrdtool to try and learn 
how it works.

here's how I defined my rrd file so I can store temperature, rel. 
humidity, windspeed, and dewpoint.

rrdtool create ~/rrdtool/weather.rrd --step 300 
DS:temp:GAUGE:600:-273:5000 
RRA:AVERAGE:0.5:1:1200RRA:MIN:0.5:12:2400 
RRA:MAX:0.5:12:2400RRA:AVERAGE:0.5:12:2400 
DS:humidity:GAUGE:600:0:100 RRA:AVERAGE:0.5:1:1200 
RRA:MIN:0.5:12:2400 RRA:MAX:0.5:12:2400 RRA:AVERAGE:0.5:12:2400 
DS:windspeed:GAUGE:600:-273:5000 
RRA:AVERAGE:0.5:1:1200RRA:MIN:0.5:12:2400 
RRA:MAX:0.5:12:2400RRA:AVERAGE:0.5:12:2400 
DS:dewpoint:GAUGE:600:-273:5000 
RRA:AVERAGE:0.5:1:1200RRA:MIN:0.5:12:2400 
RRA:MAX:0.5:12:2400RRA:AVERAGE:0.5:12:2400

and here's the data I work from: I can grab this with a script 
called GrabWeather (part of the gkrellmweather plugin). You just 
need an airport code to use it.go to http://www.frankylam.com for 
details.

Seattle, Seattle Boeing Field, WA, United States (KBFI) 47-32-45N 
122-18-49W 4M
Jan 28, 2002 - 11:53 AM EST / 2002.01.28 1653 UTC
Wind: from the N (360 degrees) at 3 MPH (3 KT):0
Visibility: 10 mile(s):0
Sky conditions: overcast
Temperature: 36.0 F (2.2 C)
Dew Point: 30.0 F (-1.1 C)
Relative Humidity: 78%
Pressure (altimeter): 30.11 in. Hg (1019 hPa)
ob: KBFI 281653Z 36003KT 10SM SCT010 BKN016 OVC025 02/M01 A3011 
RMK AO2 SLP194 SCT V BKN CIG RGD BINOVC N
E-S T00221011
cycle: 17

I run it thru a perl parser and get this:

1012240912:36.0,1012240912:78,1012240912:3,1012240912:30.0

and pass that to rrdtool update.

to use mrtg, choose any two datapoints (temp and dewpoint, let's 
say) and dump them out thusly:

36
30


I'm sure there are more elegant ways to do this, but my solutions 
are rarely elegant.


--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list