Setup (in and out) counter rules on your firewall, and write a small script that periodically reads the counters.
I did the same some days before (with ipfw on FreeBSD) and catched our ISP in providing us half of the bandwidth we pay for. They were very sorry for the mistake...
Here is the script I use with ipfw:
#!/usr/local/bin/bash
IPFW=/sbin/ipfw
AWK=/usr/bin/awk
GREP=/usr/bin/grep
DATE=/bin/date
CAT=/bin/cat
TAIL=/usr/bin/tail
IDO=`date +"%Y%m%d%H%M"`
CNTOUT=`$IPFW -a l | $GREP -E "^00350" | $AWK '{ printf $3 "\n" }'`
CNTIN=`$IPFW -a l | $GREP -E "^00351" | $AWK '{ printf $3 "\n" }'`
LASTOUT=`$TAIL -1 /var/log/nettraffic | $AWK '{ printf $2 "\n" }'`
LASTIN=`$TAIL -1 /var/log/nettraffic | $AWK '{ printf $3 "\n" }'`
CUROUT=`expr $CNTOUT - $LASTOUT`
CURIN=`expr $CNTIN - $LASTIN`
echo $IDO $CNTOUT $CNTIN $CUROUT $CURIN >> /var/log/nettraffic
Do not forget to refer to your firewall manual on how to setup and read counter rules, and correct the above script accordingly. Also check the command paths in the script, since they may be FreeBSD specific. If you run the script by cron in each minute, it will generate a logfile with the following data on each line: time, out counter position, in counter position, out traffic, in traffic. Anyway, the peaks in the traffic log file will show you the actual speed of your network connection.
Last edited by J_Szucs; 09-23-2003 at 09:53 PM.
|