From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leonardo Balliache Date: Sat, 02 Aug 2003 04:28:19 +0000 Subject: Re: [LARTC] Bandwidth Monitor Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: lartc@vger.kernel.org Hi, Have a look at=20 http://ldp.kernelnotes.de/HOWTO/Querying-libiptc-HOWTO/bmeter.html Best regards, Leonardo Balliache At 01:50 p.m. 01/08/03 -0300, you wrote: >Anybody knows about one bandwidth meter to use in Bering. >This is a script i built, it's works wel, but it's not very nice!!! =3DP > >#!/bin/bash > ># Bandwidth Monitor > >device=3Deth0 > >bytes=3D`grep $device /proc/net/dev | cut -f 2 -d : | cut -d ' ' -f 2` >kbytes=3D`expr $bytes / 1024` >actual=3D$kbytes > >i=3D1 >x=3D0 >total=3D0 >while [ $i -le 2 ] >do > x=3D`expr $x + 1` > bytes=3D`grep $device /proc/net/dev | cut -f 2 -d : | cut -d ' ' -f = 2` > kbytes=3D`expr $bytes / 1024` > valor=3D`expr $kbytes - $actual` > actual=3D$kbytes > > if [ $x =3D 5 ] > then > x=3D2 > total=3D$promedio > fi > > total=3D`expr $total + $valor` > promedio=3D`expr $total / $x` > > echo actual: [$valor Kb/s] - promedio: [$promedio Kb/s] > sleep 1 > >done > >Best regards. > >Sebasti=E1n A. Aresca > >_______________________________________________ >LARTC mailing list / LARTC@mailman.ds9a.nl >http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/ Practical QoS http://opalsoft.net/qos _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/