[manchesterwireless] Bandwidth Monitoring

G.W. Haywood ged at jubileegroup.co.uk
Mon Sep 26 16:21:18 BST 2005


Hi Andy,

On Mon, 26 Sep 2005, Andy Gauton wrote:

> It is possible to do Bandwidth Monitoring on a WRT54G with Sveasoft
> firmware running in WDS mode.  If so, what is involved

Do you mean "Is it" not "It is" ?

Any Linux-based system can tell you the number of bytes transferred
over any interface, for example:

/sbin/ifconfig eth0 | grep bytes

> would I need to put additional software on the router?

Nope.  You might want to write a three-line script or something.
I tend to use crontab, here's part of the crontab on one of my
firewalls:

root at tornado:~ # crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.364 installed on Thu Jul 21 10:05:48 2005)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
# [snip]
39 00 * * *  /bin/date                             >> /var/log/ifconfig.log
40 * * * * /bin/echo -n "eth0:  " >> /var/log/ifconfig.log ; /sbin/ifconfig eth0  | /bin/grep bytes >> /var/log/ifconfig.log
41 * * * * /bin/echo -n "eth1:  " >> /var/log/ifconfig.log ; /sbin/ifconfig eth1  | /bin/grep bytes >> /var/log/ifconfig.log
42 * * * * /bin/echo -n "wlan0: " >> /var/log/ifconfig.log ; /sbin/ifconfig wlan0 | /bin/grep bytes >> /var/log/ifconfig.log
00,15,30,45 * * * * export TERM=xterm; /usr/bin/top -b -n1 >>/var/log/top.log

As you can see, every hour I log the bytes transferred by each of the
three interfaces.

> I'd prefer a web based stats page for simplicity,

Simplicity?!

> but anything will do.

Then write a file, dump it now and again to some place convenient and
use gnuplot or whatever to plot a graph.  You can script it in a few
minutes. :)

> Want to monitor daily/weekly/monthly usage.

See

http://www.jubileegroup.co.uk/radio/bandwidth.gif

for an example of bandwidth usage by an (anonymous) client of ours.
That graph is for the processor load using 'top, but you get the idea.
Contact me off-list if you need more information.

73,
Ged.



More information about the ManchesterWireless mailing list