[rrd-users] Re: Migrating RRD data to RDBMS

Alex van den Bogaerdt alex at ergens.op.het.net
Thu Jan 26 16:14:19 MET 2006

On Thu, Jan 26, 2006 at 03:08:16PM +0100, Ralf Kruedewagen wrote:
> My RRD database do not consolidated, since I only use one RRA with 
> steps=1. And my STEP is almost always 900. So, it should fit.
> If you say "to a certain point", how would you do it ?

Ignoring the daylight saving issue:

You want localtime 8:00 to 18:00.  10 hours per 24 hours.
Keep that interval each day, set the rest to unknown or to zero.

You want monday to friday.  Keep that interval (which has
undesired time removed already) and set the rest to unknown or
to zero.

Remaining: office hours.  The average computed may be too low.
This will be the case if you used zero to mask out the other
hours.  Compensate by multiplying by 24/10 and by 7/5.

Without generating complete CDEFs, and without testing and
debugging, I think the following should get you started:

if (localtime more than 08:00 and less or equal to 18:00) {
    then use ds0
    else use value zero


if (localtime between saturday and sunday) {
    then use value zero
    else use outcome of previous CDEF


You will need to tweak the numbers 21000 and 28000 so that they
match the beginning of saturday and the end of sunday.

The numbers are no magic.  Modulo 86400 gives the hour in a day,
modulo 604800 gives the hour in a week.  Weeks do not start on
monday, they start on friday 00:00 UTC.

There may be some errors in what I wrote here.  I didn't even
start up rrdtool; it does however show the way you could be
working towards a result.

Alex van den Bogaerdt

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://lists.ee.ethz.ch/rrd-users
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi

More information about the rrd-users mailing list