[rrd-users] Graphing Sparse Data

Simon Hobson linux at thehobsons.co.uk
Wed May 14 20:14:19 CEST 2008


Laack,Jacob C wrote:

>The RRD data is compiled in 4 hour, 24 hour, 1 week, 1 month and 1 
>year durations.

That doesn't matter !

>The data is plotted about every 6 hours rather than at specific 
>times.  That's just how nagios works.  All of my graphs for the 
>above durations are blank.  If I force a check (manually get a data 
>point) a couple times, I get a small pixel or two long line.  But 
>the next day, my graphs have no dots or lines afterwards even though 
>2 or 3 points of data are in there somewhere.

Your heartbeat setting is wrong.

>I thought about your last paragraph...  If my checks are 6 hours 
>apart and my shortest RRD is 4 hours, wouldn't that pretty much keep 
>the RRD's empty most of the time?

No, it doesn't matter.

How did you define your RRDs ? There are TWO particular values you 
need to be aware of :

Firstly, the step setting for the whole RRD :
>  --step|-s step (default: 300 seconds)
>  Specifies the base interval in seconds with which data will be fed 
>into the RRD.

This is NOT when you have to feed it data, but it is the fixed length 
of the 'buckets' where the data will be stored.

Then for each DS you have a heartbeat setting :
>  DS:ds-name:GAUGE | COUNTER | DERIVE | ABSOLUTE:heartbeat:min:max

>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*.


Firstly, if we just assume heartbeat is long enough, if you only feed 
data in at long periods, then rrdtool will simply normalise that data 
across the time since the previous update. So for example, suppose 
your step is 1 hour and your DS type is type Counter. You update at 
00:00 with a value of zero, then at 04:00 with a value of 28,800 
(that's 2x4x3600). The rate is simply 28,8400 / 14,400 (quantity / 
time) to give you a rate of 2/second. If you look in your database 
(with rrdtool fetch for example) then you will see that the values 
for 01:00, 02:00, 03:00, 04:00 will all be set to 2.000. The value at 
00:00 will depend on what was fed in beforehand.

If however your step is 3 hours, then after the same updates, the 
value at 03:00 would still be 2.000, but the next step at 06:00 would 
be NaN as it can't be calculated yet. If you update again on or after 
06:00 with the same value of 28,800 then you will find that the rate 
for 06:00 will now be 0.6667. This is derived from 1hour (the 03:00 
to 04:00 worth of your previous update) at rate 2 plus 2 hours (04:00 
to 06:00) at rate 0.

That is the normalisation part and is explained fully in the tutorials.


Now, in your case, you are updating at relatively long intervals - 
this is where heartbeat comes in. I suspect that your heartbeat is 
quite small - so if your updates are (say) 6 hours apart, then the 
time between updates is longer than heartbeat and the program assumes 
you have missing data and so the intervening period has an unknown 
value. You probably need to set your heartbeat at something like 8 
hours.

Be aware however that this means you could miss data and not have it 
show up in the graphs.



More information about the rrd-users mailing list