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

Barry Irwin bvi-mrtg-list at rucus.ru.ac.za
Fri Nov 10 21:15:21 MET 2000


On Fri 2000-11-10 (10:24), Isaac Grover wrote:
> > Any comments or solutions would be greatly appreciate.
> 
> It's perfectly conceivable you could hack together a perl program to poll
> inOctets/outOctets every minute or so for a more accurate idea of actual
> usage, pipe the results to a flat file, and sum the total usage at the end
> of the month.  The downside is you'd need to build the graphing engine
> yourself if you wanted to watch trends (unless of course you're already
> using mrtg).
> 
I'd suggest using an external script to collect your data, the only real
change to an existing mrtg setup, would be to have the target changed to an
external script.  This script then collects the SNMP data from your device,
and passes it onto mrtg which remains non the wiser.  The crux comes in that
in addition to passing onto mrtg, it logs to a plain text file which is then
summed at the end of a given period.

either use perl (Net::SNMP)  or a shell script calling snmpget <OID>

summation should be fairly easy in perl:

                               read in a value
                                      |
                    is it bigger than the previous value
                        /                       \
            Yes, Subtract and add           No. Add Value to total ( counter 
                Difference to total           most likely wrapped/rebooted)




Barry


-- 
--------------------------------------------------------------------------
Barry Irwin 				 	IRC:  balin at zanet (#linux)
bvi at moria.org  					http://rucus.ru.ac.za/~bvi
Whois BI414		- PMPN8EZ -		http://moria.org
--------------------------------------------------------------------------

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