Re: [squid-users] Traffic Meter

From: Antony Stone <Antony@dont-contact.us>
Date: Thu, 20 Nov 2003 21:55:40 +0000

On Thursday 20 November 2003 9:41 pm, Helder C Souza wrote:

> Hi,
>
> Someone knows if squid can make a report (log) of the traffic utilization
> of my link, per protocol (ftp,www, streamming or overall traffic ) .
> I donīt have a machine to install a mrtg and if squid should help with
> simple numbers it should be great.

I don't think Squid can do this for you, but some simple netfilter (iptables)
rules (assuming you're using Linux) would do the trick:

iptables -A INPUT -p tcp --sport 80
iptables -A INPUT -p tcp --sport 443
iptables -A INPUT -p tcp --sport 20
iptables -A INPUT -p tcp --sport 21

(These rules assume that the machine itself if making the connections - if
it's actually a router instead then change INPUT to FORWARD).

The command "iptables -Z" will reset the packet & byte counters to zero.

The command "iptables -L -n -v -x" will show you how many packets & bytes
have been matched by each rule - in the above examples, http, https, ftp
data, and ftp control.

Add as many rules as you like for different port numbers.

Antony.

-- 
What a waste it is to lose one's mind -- or not to have a mind.   How true 
that is.
 - Dan Quayle, vice-president of the United States of America
                                                     Please reply to the list;
                                                           please don't CC me.
Received on Thu Nov 20 2003 - 14:55:49 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:21:26 MST