Re: wanted A tool to measure bandwidth....

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 21:22 12/05/2005, Kenneth Kalmer wrote:

On 5/12/05, Dmytro O. Redchuk <dor@xxxxxxx> wrote:
> On Thu, May 12, 2005 at 05:51:28AM +0100, KartheeK wrote:
> > Hello Everybody,
> > I have configured a Linux box that does traffic shaping. Its working wonderfully fine, just as expected...Now i want to measure the bandwidth consumed by each of my hosts....But I dont want SNMP to run on all the hosts[as required by MRTG]
> > I used iptraf on my linux box, but it only measures the bandwidth on interface basis only....
> > I tried installing traffic-vis, its not working properly and there is know documentation of how to get it running.....
> > I also tried ntop, it installs, but dosent work.....
> > I have been scratching my head for the past one week....
> >
> > So my problem: I am in search of a tool that measures bandwidth consumed by each host on my LAN without requiring SNMP to run on the hosts...
> >
> > Now, is there any tool....
> > Any input regarding the matter is a welcome.....
> > Infinite Thanx in Advance.....
> > Regards
> > KartheeK
> >
> > Yahoo! India Matrimony: Find your life partneronline.
>
> I have written some scripts just for me -- I'll be glad if you find it
> useful in any sense.
>
> http://www2.ldc.net/~dor/py-htbstat/
>
> But probably that's not right what you need.


Maybe not what he needed, but this is excellent.

Indeed! Looks very good, I will definately be looking at using that for helping to analyze the performance of HTB.


However one comment - reading byte counters from TC (assuming thats what it does - I havn't studied it or installed it yet) for the purposes of billing customer usage is not recommended, as the HTB docs specifically say that they are not completely accurate due to rounding. (And we have also found they are a bit inaccurate)

What we do is set up firewall rules based on customer IP address(es) and then monitor the byte counters. This can be read from MRTG without any SNMP. So for example: (ip's changed to protect the innocent ;)

/sbin/ipchains -A input -i eth0 -s 192.168.1.10
/sbin/ipchains -A output -i eth0 -d 192.168.1.10

The above rules will match for byte counting purposes but still allow following rules to be processed for firewalling purposes. Something similar should be possible with iptables.

Then in a shell script:

ipchains -xvnL output | grep -w "eth0" | grep -w "192.168.1.10" | awk '{print $2}'
ipchains -xvnL input | grep -w "eth0" | grep -w "192.168.1.10" | awk '{print $2}'
echo ""
echo "Customer Name"


Then in mrtg.cfg:

Target[CustomerName]: `/root/mrtg/bin/get-radiolink-use`

This is a simplified example that doesn't take into account more than one customer. To scale up you would want the various scripts to be automatically generated...

We find byte counting using ipchains/iptables to be very accurate, and no SNMP is needed provided the byte counting is done on the same machine as mrtg is run...

Regards,
Simon

_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux