[rrd-users] rrdtool - manually creating a rrd database with multiple records
linux at thehobsons.co.uk
Sun Dec 13 10:33:16 CET 2009
>I'm trying to run a simulation for an university project. The graph must
>have 9 records (I am monitoring 9 parameters from 3 different rivers -
>"quantity of rain fallen", "level" and "quantity of water which flows".
>I got some numbers from some simulating software someone wrote in C. The
>following script is used for creating and updating a rrd database:
>rm -rf rivers.rrd
>rrdtool create rivers.rrd \
>--start 1260399480 \
>--step 300 \
>rrdtool update rivers.rrd --template
>time for creating the database is 1260399480, stepping is 300 seconds.
>start time for entering data is 1260399486, then data is entered with
>initial time + 300 seconds.
OK, first of all, go to http://www.vandenbogaerdt.nl/rrdtool/ and
read Alex's tutorial on normalisation. Then realise that ALL periods
in rrd are referenced to unix epoch (ie midnight on 1st Jan 1970
UTC). Since 1260399486 (Wed 9 Dec 2009 22:58:06 GMT) is not
divisible by 300, then the data will be normalised to steps that
start and end on timestamps which are divisible by 300. The same
applies to aggregations, by aggregating 12 steps you will reduce the
data to slots that start and end on whole hours - eg 11am, not 10:47
>now: rrdtool fetch does NOT provide any data from the rrd database. I just
>have the header line with all the DS names, then two rows each with a
>timestamp which I cannot find in the input lines, each row displays "nan"
>(not a number?) 9 times.
Did you specify a resolution or time period when fetching the data ?
It's quite possible that rrd is trying to give you the larger
aggregation (288 steps, 24 hours). If that is the case, then you
simply don't have enough data for the results to be valid - you need
at least 12 hours worth of data (0.5 x 24hr) - and the rows would
have timestamps of 1260316800 and 1260403200.
In case you are wondering, GNU Date has a useful feature of being
able to work with these dates. "date -r n" will convert from n
seconds after epoch into a readable date, and "date '+%s'" will
format a date in seconds since epoch.
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