[plug] Open Source download meters

Patrick Coleman blinken at gmail.com
Sun Jul 22 22:15:30 WST 2007


On 7/22/07, Caleb Duggan <caleb.duggan at gmail.com> wrote:
> Hi,
> Does anybody know of any decent open source download meters? I'm looking
> for one to install on individual computers, keep logs of internet usage
> and, to support Mac(i can probably install a linux meter on OSX), Windows
> and Linux. So far google has been of little help.

I think there was a thread on the list a little while ago relating to
this; but one solution I didn't see suggested was iptables, if you
want a command-line linux bandwidth monitoring tool. You won't get
logging, but what people generally do is to run a script periodically
that saves the current bandwidth counters to disk.

On each machine run:

# iptables -A OUTPUT -j ACCEPT
# iptables -A INPUT -j ACCEPT

to establish the rules, then:

# iptables -L -n -v

to view the bandwidth counters. You will see something like:

Chain INPUT (policy ACCEPT 164 packets, 21546 bytes)
 pkts bytes target     prot opt in     out     source
destination
   41  2180 ACCEPT     0    --  *      *       0.0.0.0/0
0.0.0.0/0

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source
destination

Chain OUTPUT (policy ACCEPT 203 packets, 198K bytes)
 pkts bytes target     prot opt in     out     source
destination
  117  127K ACCEPT     0    --  *      *       0.0.0.0/0            0.0.0.0/0

The bandwidth info is column two, under 'bytes', and you can see input
and output is broken down for you.

Adding the -Z option resets the counters, ie:

# iptables -L -n -v -Z

will display and reset the counters.

Note this will not persist over a reboot, so you will need to put the
two commands above into a script and run it when the system starts to
activate the monitoring.

There's a bit of information at http://www.linux.com/articles/50649,
more if you search for 'iptables bandwidth monitoring'.

Hope that helps.

-Patrick

-- 
http://www.labyrinthdata.net.au - WA Backup, Web and VPS Hosting



More information about the plug mailing list