D&C GLug - Home Page

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

Re: [LUG] Bandwidth monitoring script

 

On Fri, 4 Sep 2009, Martijn Grooten wrote:

All,

I'm looking into something that monitors incoming and outgoing
bandwidth on a Linux machine; ideally something that outputs the
average values per minute (or even second) to a log file that I can
then scrutinize.

The machine runs SLES11 and runs several daemons (httpd, smtpd, sshd)
while also working as a router for a LAN with about a dozen machines
behind it. I think I need a faster connection to the internet but I
want to be 100% sure that a) this is the case and b) it isn't just a
matter of one process/machine taking up most of the bandwidth.
/sbin/ifconfig gives the number of RX and TX packets as well as bytes,
so I can write a script that just check it every x seconds and
subtracts the previous value, but I'm not 100% sure if these are
really the numbers I'm looking for.

Do you serously need stats to the minute/second?

What I'd suggest is enabling SNMPD and getting something to read the ethernet stats via that using a tool to read and track them.

MRTG is an old, but very good tool to do this - I use it a lot myself. It only has a resolution of 5 minutes though - however I've found this adequate for my needs. (That's a 5-minute average though - so it only reads the counters every 5 miuntes)

rrdtool in conjunction with back-end graphing softwares can get you to a one minute resolution, but I've never looked at it.

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.

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