From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?Sebasti=E1n_Aresca?= Date: Fri, 01 Aug 2003 16:50:33 +0000 Subject: [LARTC] Bandwidth Monitor Message-Id: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: lartc@vger.kernel.org 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/