[rrd-users] Using rrdtool to create graphics for an array of sensors

l f 770dev at gmail.com
Tue Oct 7 13:30:05 CEST 2008


I'm a new user of rrdtool, and I have a few questions about it.
I have read most of the tutorials and documentation, but I still
haven't figured out a few things.

Here's what I'd like to do:
I collect data from a series of sensors and I'd like to store these
values on a database. Latter, I'd like to plot a graphic out of a
certain portion of time.
For example, suppose I get 2 samples (x and y) once a second, for
24hrs (that's 86400 seconds). (I want to store all the samples, 2 per

Following your documentation, I created:
rrdtool create samples.rrd -b 920000000 -s 1 \
DS:x:GAUGE:2:U:U \
DS:y:GAUGE:2:U:U \

(please correct me if I'm wrong in the above command)
Do I really need to use rows=84000 in RRA? is it possible to
"increase-rows-as-you-go" ?

then I added a few sample values:
rrdtool update samples.rrd 920000001:1:2 920000002:2:3 920000003:3:4
rrdtool update samples.rrd 920000004:4:5 920000005:5:6 920000006:6:7
rrdtool update samples.rrd 920000007:7:8 920000008:8:9 920000009:9:10

and retrieved them with:
rrdtool fetch samples.rrd AVERAGE -s 920000001 -e 920000009

The resulting values started at 920000002, and ended at 920000010.
Shouldn't I get samples between  920000001 and 920000009 ?

Then I did a sample plot:
rrdtool graph samples.png -s 920000000 -e 920000009 \
--x-grid SECOND:2:MINUTE:1:HOUR:1:0:%X \
DEF:xx=samples.rrd:x:AVERAGE LINE1:xx#FF0000 \
DEF:yy=samples.rrd:y:AVERAGE LINE1:yy#00FF00

I did get a .png with the correct values, but the "x" grid is missing
from the graphic.
How can I make it appear?
Also, I'd like to select the greater of the values in each 10 sample,
so I could plot 3600 samples in a 360 pixels wide graphic. Can this be


More information about the rrd-users mailing list