[rrd-users] how record per hour data

Simon Hobson linux at thehobsons.co.uk
Wed Oct 12 13:53:13 CEST 2011

ccddtt wrote:

>  rrdtool create cpu.rrd --step 3600 DS:cpufree:GAUGE:700:0:100 
>then,i use this command insert data to cpu.rrd:
>/usr/bin/rrdtool update cpu.rrd N:55
>not found data in cpu.rrd

No there wouldn't be - that is correct operation

>and then,i used crond per hour run this command inster data to 
>cpu.rrd, also no data.

Correct, there won't be.

First step, have you read the documentation ?

I also recommend Alex's tutorials at http://www.vandenbogaerdt.nl/rrdtool/
In particular se "Rates, normalizing and consolidating"

Now, your specific problem is that RRD is doing what you've told it 
to do - which is not what you want it to do ! The 700 in your create 
command means to set the heartbeat to 700 seconds, which is 
considerably less than the 3600 seconds in an hour. From the 
documentation linked to above :
>heartbeat defines the maximum number of seconds that may pass 
>between two updates of this data source before the value of the data 
>source is assumed to be *UNKNOWN*.

So, you provide an update.
After 700 seconds, if you haven't provided another update, then the 
data is assumed to be unknown.
After a whole hour, you do another update. Because your updates are 
further apart than the heartbeat value, the previous data is no 
unknown and so the data up to the time of your second update is 

This will continue - each hour you provide an update, but each time 
it's been too long and so the previous data is effectively ignored.

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