[rrd-users] Re: Not enough values in the DB

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Fri Aug 11 13:00:27 MEST 2000


Yann Bizeul wrote:

> Here is what I do to create my db :
> 
> rrdtools create -s 3600 \
>     DS:solde1:GAUGE:7200:U:U \
>     DS:solde2:GAUGE:7200:U:U \
>     RRA:LAST:0.5:1:336 \
>     RRA:MIN:0.5:1488:12 \
>     RRA:MAX:0.5:1488:12
> 
> this DB is supposed to store my bank accounts values.
> I want to get them every hours (3600s), if no values are fed after 7200s,
> the value in unknown
> the first RRA is supposed to keep 336 * 3600 records (1 week)
> the second one is supposed to keep the MIN value on a whole month (1488 *
> 3600) for 1 year (12 month)
> the third is the same with the MIN value
> 
> What do I wrong, the db keeps only 26 records for the first RRA and 2
> records for the others...

Given the amount of errors in this single mail I can assume your
accuracy won't be any better when actually writing the script.

You are using a step time of 3600 seconds.
An hour is 60 minutes of 60 seconds --> 3600 seconds, correct

Each day is 24 hours, or 24 steps in your case
A week is 7 days so it is 7*24 steps --> 168 steps
A month is 31 days so it is 31*24 steps --> 744 steps

Reading the manual page for RRDtool create, filling in the values where
appropriate gives:

> rrdtools create -s 3600 \

rrdtools         --> rrdtool
FILENAME missing --> solde.rrd

rrdtool create solde.rrd -s 3600 \

>     DS:solde1:GAUGE:7200:U:U \
>     DS:solde2:GAUGE:7200:U:U \

>     RRA:LAST:0.5:1:336 \
336 --> 168

>     RRA:MIN:0.5:1488:12 \
>     RRA:MAX:0.5:1488:12

1488 --> 744

Using the corrected command, I created a database.  This database
looks fine.  I dumped the database and while viewing the xml file
I see data from 2000-08-04 13:00:00 to 2000-08-11 12:00:00 in the
first RRA (one week exactly).
The second RRA:
from 1999-08-16 02:00:00 CEST to 2000-07-22 02:00:00 CEST

Problem! A month is not exactly 31 days.  This won't work as expected
so you change your RRA definition.  In stead of stepping 31 days, you
would probably like to step per day.  rrdtool graph (or rrdtool fetch)
will cope with this perfectly.

Changing the command again I get:

rrdtool create solde.rrd -s 3600 \
   DS:solde1:GAUGE:7200:U:U \
   DS:solde2:GAUGE:7200:U:U \
   RRA:LAST:0.5:1:168 \
   RRA:MIN:0.5:24:366 \
   RRA:MAX:0.5:24:366

Doing the rrdtool dump again, it looks okay now.

-- 
   __________________________________________________________________
 / alex at slot.hollandcasino.nl                  alex at ergens.op.het.net \
| work                                                         private |
| My employer is capable of speaking therefore I speak only for myself |
+----------------------------------------------------------------------+
| http://faq.mrtg.org/                                                 |
| http://rrdtool.eu.org  --> tutorial                                  |
+----------------------------------------------------------------------+

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list