[rrd-users] Re: combining rrd's of same 'kind'

Alex van den Bogaerdt alex at ergens.op.het.net
Sat Dec 14 13:45:37 MET 2002

On Fri, Dec 13, 2002 at 03:47:13PM -0600, Frank DiGravina wrote:

> I have two rrd's that were generated by mrtg; each represents some
> time period and each has looked at a comparable interface on two
> distinct machines.  More simply, I have rrd-A and rrd-B.  Rrd-A
> precedes rrd-B in time.  I simple want to add the historical data from
> A to B, which is currently active.  Is there a simple way to do this?

Within one polling interval do:
   Keep both databases in sync (update each one at the same time)
   "rrdtool dump" both databases
   Merge both files (see below)
   "rrdtool restore" the current database from this file

When you have both databases in sync, the differences will be only in
the content of the data.

You want to have the relevant lines from "rrd-A" and "rrd-B" in your
resulting database.

Relevant here means "before or after a certain time".  Let's call
this time "t".

This determines how to merge the files:
until end of file
    read line "a" from rrd-A
    read line "b" from rrd-B
    (check the input: the files should be the same)
    if (inside an RRA)
        if (time is before "t")
            write line "a"
            write line "b"
        write line "b"

Much of what looks like rudeness in hacker circles is not intended to give
offence. Rather, it's the product of the direct, cut-through-the-bullshit
communications style that is natural to people who are more concerned about
solving problems than making others feel warm and fuzzy.


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