Re: [LARTC] Bandwidth Monitor

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Have a look at 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!!!  =P

#!/bin/bash

# Bandwidth Monitor

device=eth0

bytes=`grep $device /proc/net/dev |  cut -f 2 -d : | cut -d ' ' -f 2`
kbytes=`expr $bytes / 1024`
actual=$kbytes

i=1
x=0
total=0
while [ $i -le 2 ]
do
    x=`expr $x + 1`
    bytes=`grep $device /proc/net/dev |  cut -f 2 -d : | cut -d ' ' -f 2`
    kbytes=`expr $bytes / 1024`
    valor=`expr $kbytes - $actual`
    actual=$kbytes

    if [ $x =  5 ]
    then
        x=2
        total=$promedio
    fi

    total=`expr $total + $valor`
    promedio=`expr $total / $x`

    echo actual: [$valor Kb/s] - promedio: [$promedio Kb/s]
    sleep 1

done

Best regards.

Sebastián A. Aresca

_______________________________________________
LARTC mailing list / LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

Practical QoS http://opalsoft.net/qos




[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux