[lug] Measuring bandwidth

Riggs, Rob RRiggs at doubleclick.net
Thu Nov 29 16:17:45 MST 2001


I use MRTG to graph network usage. It doesn't monitor total bytes sent and
received, but rather usage over time. To grab the number of received and
sent bytes on eth0 since the interface was brought up, you can use the
following command:

grep eth0 /proc/net/dev | sed 's/eth0://' | awk '{print $1,$9}'

To clear it at the beginning of the billing cycle, you might run something
like the following:

ifdown eth0; modprobe -r eth0; ifup eth0 # must unload the network module to
clear counters

The down side is that the counters are 32-bit ints, meaning they roll over
after 2 or 4GB of data pass over the NIC.



-----Original Message-----
From: DeVerter at robinsonmechanical.com
[mailto:DeVerter at robinsonmechanical.com]
Sent: Thursday, November 29, 2001 2:37 PM
To: lug at lug.boulder.co.us
Subject: [lug] Measuring bandwidth



Later today, frii.com will be moving my DSL to their service away from
Qwest.  According to my arrangement with them I am allowed monthly
transfers of 10Gb per month.  Does anyone know of utility for Linux to
monitor traffic flow across eth* ?

Cheers,
Mark d.
"Once you have tasted falling you will walk the Earth
with your eyes turned skyward, for there you have
been and there you will long to return."  - DaVinci

_______________________________________________
Web Page:  http://lug.boulder.co.us
Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug



More information about the LUG mailing list