[rrd-users] Question about importing non-realtime CSV data into RRDtool

Simon Hobson linux at thehobsons.co.uk
Wed Jan 4 18:23:43 CET 2012


v g wrote:

>I have a question about importing non-realtime data into rrdtool. 
> There is an arduino device that logs various parameters and sends 
>the CSV to a server once per day.  The data is logged for the whole 
>day obviously (at an interval of approximately every 20-23 seconds): 
> Sample below:
>
>2011/12/30 
>16:12:53,193.5,174.0,159.0,142.8,132.3,123.5,245.3,162.5,12.5,5.0,0.0,115990,40618,0
>2011/12/30 
>16:13:14,188.8,169.9,155.0,139.0,128.4,119.7,225.7,156.7,12.5,5.0,0.0,111852,39975,0
>2011/12/30 
>16:13:35,189.2,170.2,155.5,139.4,128.8,120.0,222.2,153.9,12.5,5.0,0.0,113136,40170,0
>2011/12/30 
>16:13:56,189.7,170.2,155.5,139.8,128.9,120.1,224.6,157.4,12.5,5.0,0.0,115207,39350,0
>2011/12/30 
>16:14:17,191.1,170.9,156.3,140.8,129.8,120.9,226.4,158.2,12.4,5.0,0.0,118940,38754,0
>2011/12/30 
>16:14:39,194.1,174.0,159.3,143.8,132.7,123.8,225.1,159.2,12.5,5.0,0.0,119053,38814,0
>2011/12/30 
>16:15:00,195.6,175.0,159.9,144.3,133.3,124.5,231.2,164.9,12.4,5.0,0.0,121238,38925,0
>
>I am new to RRDtool and would like to create daily, weekly, monthly 
>and yearly graphs for all this data.  For example, field 13 in the 
>data above is btu per/hr.

Really ? It look more like a count of something to me. Or do you mean 
field 14 (the last one) ?

>I am fairly new to rrdtool and played around with it and created a 
>graph using the following commands  (i had to change all the 
>date/times to epoch and do an rrdtool update of course):
>
>rrdtool create btuperhr.rrd --start 1325232008 --step 1 
>DS:btu_per_hr:GAUGE:600:1:U RRA:AVERAGE:0.5:1:100000

"step 1" is a bit short. It means having 86400 "buckets" per day, and 
you then have to process all of those to draw a graph. For a normal 
resolution of graph, 60 or 300 seconds is probably enough to keep. 
You've also set the min as 1, which means you won't be able to handle 
very low output/plant shut down situations. You've then asked RRD to 
store 100,000 1 second averaged samples (a little under 28 hours).

>rrdtool graph btuperhr.png --start 1325232008 --title="Boiler BTU 
>Dec 30 2011" --vertical-label="BTU per Hr" -x 
>MINUTE:10:HOUR:1:MINUTE:120:0:%R 
>DEF:btu_per_hr=btuperhr.rrd:btu_per_hr:AVERAGE 
>LINE2:btu_per_hr#FF0000
>
>
>the graph on the x axis doesnt look right.

Dunno, I can't see your screen from here ;-) If you want comment on 
what it looks like then you'll need to provide an example we can see.

What you are doing is OK in principal - as long as you have 
timestamped data, so you can feed it into RRD, and get RRD to munge 
it and draw pretty graphs.
-- 
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