Hey I was just curious if anyone knew of any scripts or command line programs that are out there that could be used to check bandwidth on a network. -- Andrew Rice Jr
On Jan 5, 2006, at 10:03 AM, Andrew Rice wrote:> Hey I was just curious if anyone knew of any scripts or command > line programs that are out there > that could be used to check bandwidth on a network.iptraf can do this for you, i believe; get it from yum. -steve --- If this were played upon a stage now, I could condemn it as an improbable fiction. - Fabian, Twelfth Night, III,v
Here's a PHP script that I use to give me long-term, month-to-month stats on total bandwidth usage, run from cron every 5 minutes: #! /usr/bin/php -q <? if (!$in=`/sbin/ifconfig -a eth0`) die ('Error: no input from ifconfig -a call'); $now=mktime(); # RX bytes:1294815560 (1234.8 Mb) TX bytes:3493560535 $match="/RX bytes:([0-9]+).*?TX bytes:([0-9]+)/"; if (!preg_match($match, $in, $r)) die ('Error - no matching for input from eth1'); if (!$fp=fopen("/var/log/traffic.log", 'a')) die ('Error - unable to open /var/log/traffic.log'); fwrite($fp, "$now RX: ".$r[1]." TX: ".$r[2]."\n"); fclose($fp); ?> If you want some cheezy scripts to parse the resulting data file, I can help you there too. =) -Ben On Thursday 05 January 2006 07:03, Andrew Rice wrote:> Hey I was just curious if anyone knew of any scripts or command lineprograms that are out there> that could be used to check bandwidth on a network. > > > -- > Andrew Rice Jr > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos >-- "The best way to predict the future is to invent it." - XEROX PARC slogan, circa 1978
On 05/01/06, Andrew Rice <andrew at nams.net> wrote:> > Hey I was just curious if anyone knew of any scripts or command line > programs that are out there > that could be used to check bandwidth on a network.If you run iptables, you could install ipac-ng. http://ipac-ng.sourceforge.net/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20060106/aecf693b/attachment.html>
If you're looking for something that will eat all availalbe bandwidth and report what it found, iperf is the ticket. Also see ndt: http://e2epi.internet2.edu/ndt/ which isn't exactly the same thing (although iperf is part of the backend) but is similar and cool. On Thu, Jan 05, 2006 at 09:03:35AM -0600, Andrew Rice wrote:> Hey I was just curious if anyone knew of any scripts or command line programs that are out there > that could be used to check bandwidth on a network. > > > -- > Andrew Rice Jr > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centosdanno -- dan pritts - systems administrator - internet2 734/352-4953 office 734/834-7224 mobile