[mrtg] Re: Tracking bandwidth used for period of time (a month)

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Sat Nov 11 13:08:50 MET 2000


Me wrote:
> 
> 
> Management has asked me to implement bandwidth useage tracking for one of our
> larger customers. We want to track if this customer has used over 50Gb of
> bandwidth per month (pricing reasons).  I would like to use something I have in
> place already (namely, mrtg).  

This is not hard to do.

First things first:  MRTG is not suitable for *exact* monitoring of the
amount of bandwidth used.  It will only give you an estimate.  If no
errors occur, it will give you a number that is *lower* than the real
value so your user should not object about that.  If errors did occur,
especially long outages of your monitoring equipment, routers or the
sampling of the data, MRTG might show a value that is slightly higher
than the real average.

If the user is allowed to use 50 GB per month, and you are monitoring
over 50 GB per 28 days, you know the user uses to much.  If you are
on good terms with this user and you both agree that MRTG was given
correct input (!) then you're done and you can work on a solution.
If OTOH you are measuring below 50 GB, there's no ground to object.

Make damn sure your MRTG setup is correct before doing these kind
of things.  Also, read the following, re-read it and make sure you
understand it.  If you are viewing in bits per second and do the
stuff I described below without compensating for it, you are showing
figures that are 8 times too high.

May I suggest to use MRTG to give you an indication.  If the outcome is
that the user is below, or near, 50GB then don't take any measures
based on MRTG alone! 

It shouldn't be necessary to do this but I'll be on the safe side:
I speak for myself and for myself alone.  Also, there are no
guaranties involved here other than that I did not mislead you in
any way as far as I know.  You and you alone are responsible for
any damage resulting from the use of this information.


How to do it is simple:  Below the graph you see average bytes per
second.  Now you know that during the interval of the graph there was
xxx bytes per second.  Suppose the graph is 1 month long, all you have
to do is multiply that number by the number of seconds in a month.

So: create a graph that has a width of 28 days (to be on the safe side).
This can be the monthly graph which has pixels that represent two hours.
At two hours per pixel, you need 12 pixels per day which makes 336
pixels for 28 days.  Use "XSize[target]: 336"
Multiply (by hand) the number of bytes per second by (28*86400=)
2419200 to get the bandwidth usage.

Another but similar approach:  If 50 GB per month is allowed, this is
*on average* 50,000,000,000 B / 2,419,200 s = 20,7 KBps.

If you did not clearly point out to the user that a GB is 1000*1000*1000
it might be better to do your calculations with 1024*1024*1024.  This
doesn't make much difference anyway: 22,2 KBps.

Hope this helps,
-- 
   __________________________________________________________________
 / 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:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list