[rrd-users] rrd create update problem

Karl Fischer rrd-users at ficos.de
Mon Jul 26 12:37:03 CEST 2010


> Hi Simon,
> 
> thank you for your response.
> I've read that tutorial before, but I don't understand what the following sentence means:
> "If you need boundaries at midnight your local time then don't make the mistake of specifying 86400 seconds per CDP"
> 
> Please give me another hint on how I can get my updates to work. What do you mean by "you haven't supplied enough updates"? Do I have to supply  more than one update per day? Is my crontab schedule incorrect? Is it a timezone problem (I don't think so since I use unix timestamps)?
> 
> Another think that I don't understand is why (as you wrote) my "bin doesn't finish until 02:00"? Why is it 02:00 if I created the database at 00:30:01? And ... even if I create the rrd db now (CEST 12:10 PM) I get slots with the start timestamp 02:00, why?
> 
> In your opinion, are my create and update commands correct?
> 
> I tried my best to understand the consolidating stuff, but it's not so easy as it seams.
> 
> Sorry, if I insist with this (maybe basic) questions.
> Thank you very much.
> 
>> Because you haven't supplied enough updates to "finish" a step 
>> period. Specifically, you've updated at 00:30 for a bin that doesn't 
>> finish until 02:00.
>>
>>> Why the start time is at 02:00:00 (is the difference caused by the 
>>> UTC-CEST difference )?

Hi Phil,

rrdtool storage bins are *always* $timestamp modulo $step (all relative to UTC)

That means if you choose 1 day (86400) as a step size, the recording will always
be at UTC 0:00 which happens to be 02:00 your time ...

If that doesn't meet your requirements, you should probably record on an hourly
basis and correct/convert date&time at display-time.

That also means you should choose your $start and update timestamps accordingly,
so instead of using:

timestamp=`date '+%s'`

you should use

step=86400
timestamp=$(( $(date +%s) / $step * $step ))

and for creation you should use

--start $(( $timestamp - $step ))


And: your rrd will only contain valid data after you have at least two db updates
in different bins within your heartbeat - that means with a step size of 86400
you'll see valid data after two days ...

hth
- Karl




More information about the rrd-users mailing list