D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Bandwidth monitoring script

 

On Thu, 10 Sep 2009, Martijn Grooten wrote:

On Fri, Sep 4, 2009 at 10:59 PM, Gordon Henderson wrote:
If you're reading the counters yourself, be aware that they're 32-bit and
will wrap at some point, so you need to be able to cater for that.

This isn't really relevant when the scripts compares the values to
those of a second ago, is it?

Depends on how fast the interface is going :)

However 1 second, even at Gbit speeds is OK... (however 40Gb is coming ;-)

(And yes, I do want stats to the second; some of the programs/machines
running on the LAN are sensitive to minor disruptions in network
connectivity.)

Milisecond dealer share trading then...

Am I right to assume that, if the difference in RX bytes (as seen by
ifconfig) for one network over a given period of time is, say, 1024,
then 1 kB of traffic has been received by that network connection? In
particular, does this include traffic that goes through the machine?

As far as I'm aware, it's on a per interface basis - so it's the interface that's being monitored, not the "machine". so it's it's a router, then you'll get 1024 on one interface and another 1024 on another. If it's a program sucking the data, then you'll still see 1024.

If you are going to use "ifconfig", then it will be quicker to read /proc/net/dev than fork off ifconfig and parse the output.

Gordon

--
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html