[rrd-users] Re: Howto collect information on two interfaces and put that information in one DS

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Mon Jan 7 13:16:02 MET 2002

Lars Michael Jogback wrote:

> I wonder if it is possible to collect information from
> two router interfaces and in someway put that information
> in one database. It is the usual ifInOctets that I'd like
> to collect.

It has, just as collecting one DS, nothing to do with RRDtool.
RRDtool knows nothing about what you collect.  It just stores
rates, presented to it as numbers by another application.

You need to modify this other application and thus you need

Anyway, if you add the counters each time, you will get what

In the two following calculations we work with counters A and B.
The values are "n" and "p" which stand for "now" and "previous".
The rate calculated is R.  The sum is S.

Solution using CDEF:

Ra = (An - Ap)/300
Rb = (Bn - Bp)/300
Rs = Ra+Rb

Rs = ( (An+Bn)-(Ap+Bp) ) / 300

Are these the same?

( (An-Ap) / 300 ) + ( (Bn-Bp) / 300 )
= ( (An-Ap) + (Bn-Bp ) ) / 300
= (  An-Ap  +  Bn-Bp ) / 300
= (  An+Bn  -  Ap-Bp ) / 300
= ( (An+Bn )-( Ap+Bp ) ) /300

So yes, ((An-Ap)/300) + ((Bn-Bp)/300) == ((An+Bn)-(Ap+Bp))/300

Of course you need to be careful for overflows, this will happen
more likely if you add two counters and then feed it to RRDtool.

HTH
--
__________________________________________________________________
/ 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 |
+----------------------------------------------------------------------+
| Technical questions sent directly to me will be nuked. Use the list. |
+----------------------------------------------------------------------+
| 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