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

McGlinchy, Alistair Alistair.McGlinchy at marks-and-spencer.com
Tue Jun 8 20:59:23 MEST 2004


> > I do have two different smtp servers which generate individual 
> > rrd-file representing emails received
> > 
> > I would like to merge those two rrd-files on a single plot like the 
> > following: If server A said 12 messages at 12h05
> > and server B said 14 messages at 12h05
> > I would like to have a single rrd-file which said Total of 
> 26 messages at 12h05
> > 
> > Can it be done ?
> > I tried to merge two rrd-files into a single one without success ?
> 
> AFAIK there is no "rrdtool merge" command.  There may be some 
> external command that does this, I don't know.
> 
> Question: _Why_ would you want to merge?
> 
> When graphing, why not add rates from the two rrd files and 
> plot on a single graph?
 
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.

Here are some examples which prompted me to write a script to do run the
merge.

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.

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

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 ? 

Attached is the current (and potentially working) version of this code.
Use at your own risk.  It worked for me for my MRTG files on Windows and
RRDtool v0.36 but I have not tested thoroughly at all. Hope it helps.  I
wrote it to fix problem #3 so there's a rather dubious "$reverse"
feature which might not be too obvious otherwise.

Cheers,

Alistair





-----------------------------------------------------------------------


Registered Office:
Marks and Spencer plc
Waterside House
35 North Wharf Road
London
W2 1NW

Registered No. 214436 in England and Wales.

Telephone (020) 7935 4422
Facsimile (020) 7487 2670

www.marksandspencer.com

Please note that electronic mail may be monitored.

This e-mail is confidential. If you received it by mistake, please let us know and then delete it from your system; you should not copy, disclose, or distribute its contents to anyone nor act in reliance on this e-mail, as this is prohibited and may be unlawful.

The registered office of Marks and Spencer Financial Services PLC, Marks and Spencer Unit Trust Management Limited, Marks and Spencer Life Assurance Limited and Marks and Spencer Savings and Investments Limited is Kings Meadow, Chester, CH99 9FB. These firms are authorised and regulated by the Financial Services Authority. 


-- Attached file removed by Ecartis and put at URL below --
-- Type: application/octet-stream
-- Desc: rrdmerge3.pl
-- Size: 6k (6694 bytes)
-- URL : http://www.ee.ethz.ch/~slist/p/rrdmerge3.pl


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