[rrd-users] Re: how to merge 2 rrd-files

Alex van den Bogaerdt alex at ergens.op.het.net
Tue Jun 8 23:20:54 MEST 2004

On Tue, Jun 08, 2004 at 07:59:23PM +0100, McGlinchy, Alistair wrote:

> Although I agree with your suggestion that using CDEFs adding two rrds
> to build a summed graph is a good idea this does still not remove the
> usefulness of an rrdmerge utility.  I am presently working on a perl
> script to merge two rrds together. This is not so much because I want to
> *add* two rrds together, but because I want to update import data.

I do not want to discourage your efforts however I can answer all
three of your example questions.  This doesn't mean your script is
worthless, it just means _I_'d do without.

> Example 1:
> You are running MRTG using 32bit SNMP counters and you want to switch to
> 64 SNMP counters.  If you just change your configs you will get enormous
> spikes in each graph as the 64 bit counters will be much bigger than the
> 32 bit, but may still be valid data for the RRD. My solution is to run
> MRTG with 64 bit counters and have it create a brand new RRD. Then you
> can merge the old RRD data from 32 bit collections into the new RRD.

Step 1:  stop updating using the 32-bit counter
Step 2:  insert NaN in the stream (rrdtool update ... N:U)
Step 3:  start updating using the 64-bit counter

> Example 2:
> Your collection server crashes and you are in a mad panic. You start up
> collections on a separate server while you fix your server.  What do you
> do with the data collected on the backup server when your normal
> collection box is fixed...?

Step 1: update both databases simultaniously (so that they're in sync)
Step 2: a:  rrdtool dump database1.rrd > database1.xml
        b:  rrdtool dump database2.rrd > database2.xml
Step 3: copy interesting parts from both xml files into a third
Step 4: rrdtool restore newdatabase.xml newdatabase.rrd

This is the most complex solution.  Then again, how often are you
going to make this mistake?

> Example 3: 
> You give up on the crappy SNMP service on Windoze and decide to monitor
> server utilisation via the switch port interface instead. What do you do
> with the old rrd ? 

See Example 1, but make sure to switch the inputs
(i.e.  "rrdtool update ...  N:a:b" becomes "rrdtool update ... N:b:a")

I ask you to respect any "Reply-To" and "Mail-Follow-Up" headers.  If
you reply to me off-list, you'd better tell me you're doing so.  If
you don't, and if I reply to the list, that's your problem, not mine.

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