Results 1 to 9 of 9

Thread: Real-time bandwidth use

  1. #1

    Real-time bandwidth use

    Is is possible to get a value of the actual download/upload rate in kb/s?
    (via telnet)

    thanks,
    [ WL-500G | fw: 1.9.2.7-7f ]

  2. #2
    Join Date
    Apr 2004
    Location
    Netherlands
    Posts
    1,308
    Ik now that you can get upload values by doing
    Code:
    wshaper status eth1
    if you use Wondershaper.

    There are other users who posted traffic accounting scripts, you might want to check them out.

  3. #3
    Join Date
    Jun 2004
    Location
    Delft, The Netherlands
    Posts
    62

    iptraf or vnstat

    See https://wl500g.info/showthread.php?t=666 for iptraf or use inclused executable of vnstat, use it with vnstat -tr to see traffic in last 5 seconds. You need to make a directory /var/lib/vnstat. If you want to use the database options, make a symbolic link to a usb disk. In iptraf you can use filters to select specific traffic on a specfic interface. Vnstat gives all traffic on an interface.
    Attached Files Attached Files

  4. #4


    cool!
    thanks!
    [ WL-500G | fw: 1.9.2.7-7f ]

  5. #5
    Join Date
    Jun 2004
    Location
    Portugal
    Posts
    5

    Arrow cat, grep and sed (no awk)

    Quote Originally Posted by gwl
    Is is possible to get a value of the actual download/upload rate in kb/s?
    (via telnet)

    thanks,

    This is my solution...
    Still figuring out how to use crond to take "snapshots"...

    cat /proc/net/dev | grep ":" | sed -re 's/ +/ /g' | sed -re 's/ //' | sed -re 's/: /:/' | sed -re 's/ .+//'




  6. #6
    Join Date
    Aug 2004
    Location
    Germany
    Posts
    377
    Quote Originally Posted by vector
    [FONT=Verdana]
    cat /proc/net/dev | grep ":" | sed -re 's/ +/ /g' | sed -re 's/ //' | sed -re 's/: /:/' | sed -re 's/ .+//'
    Nice think, it works.
    Still i´m not sure what is the best solution from all posted ones here in the Forum. darkstat is such a nice think but the output tends to me from meaningless to uncorrect. What is the "golden way" to measure throughput under linux. DevFs, a filter rule, one of the special programs, the ifconfig value ... ?

    In general, some formated value readable from the Web IF like currend / hour / day would be nice. For my curiosity, but maybe very interresting for users of volume flatrates.

    Greets
    My Stuff: WL-500g, Mapower H31x 10GB HD, Philips Webcam Vesta PRO, TerraTec Webcam PRO, USB Hub

  7. #7
    Join Date
    Dec 2004
    Location
    Skopje, Macedonia
    Posts
    13
    Search the forums for ltraf. It's small program that does only that, realtime bandwith monitor. Hopefully, if you are lucky , you can also filter the bandwith with bpf filters.
    "What's the color of a chameleon put onto a mirror?" - Stewart Brand.

  8. #8
    Join Date
    Dec 2004
    Location
    Skopje, Macedonia
    Posts
    13
    cat /proc/net/dev | grep ":" | sed -re 's/ +/ /g' | sed -re 's/ //' | sed -re 's/: /:/' | sed -re 's/ .+//'
    You can get the same results with plain old ifconfig
    "What's the color of a chameleon put onto a mirror?" - Stewart Brand.

  9. #9
    Join Date
    Jun 2004
    Location
    Portugal
    Posts
    5

    Talking Generating Stats for use with WEB Clients

    Quote Originally Posted by WlanMan
    Nice think, it works.
    Still i´m not sure what is the best solution from all posted ones here in the Forum. darkstat is such a nice think but the output tends to me from meaningless to uncorrect. What is the "golden way" to measure throughput under linux. DevFs, a filter rule, one of the special programs, the ifconfig value ... ?

    In general, some formated value readable from the Web IF like currend / hour / day would be nice. For my curiosity, but maybe very interresting for users of volume flatrates.

    Greets
    Using DevFS and have giving up on crond (doesn't work don't know why), i'm using the following for my stats collection:

    /usr/local/sbin/post-boot
    ...
    mkdir -p /tmp/wwwstats
    while true; do sleep 60; /usr/local/sbin/makeStats; done &
    busybox_httpd -p 81 -h /tmp/wwwstats
    ...

    /usr/local/sbin/makeStats
    #!/bin/sh

    OUT=/tmp/wwwstats/stats.txt

    date > $OUT
    echo "---" >> $OUT
    cat /proc/loadavg >> $OUT
    echo "---" >> $OUT
    cat /proc/meminfo >> $OUT
    echo "---" >> $OUT
    cat /proc/net/dev | grep ":" | sed -re 's/ +/ /g' | sed -re 's/ //' | sed -re 's/: /:/' | sed -re 's/ .+//' >> $OUT
    echo "---" >> $OUT



    This generates the following file:

    Wed Jan 12 02:59:25 GMT 2005
    ---
    1.54 1.47 1.47 2/33 12841
    ---
    total: used: free: shared: buffers: cached:
    Mem: 14528512 12689408 1839104 0 839680 3850240
    Swap: 0 0 0
    MemTotal: 14188 kB
    MemFree: 1796 kB
    MemShared: 0 kB
    Buffers: 820 kB
    Cached: 3760 kB
    SwapCached: 0 kB
    Active: 4352 kB
    Inactive: 3464 kB
    HighTotal: 0 kB
    HighFree: 0 kB
    LowTotal: 14188 kB
    LowFree: 1796 kB
    SwapTotal: 0 kB
    SwapFree: 0 kB
    ---
    lo:20497426
    eth0:1997925438
    eth1:4017400368
    eth2:3996596754
    br0:1782300726
    ---


    Then, its up to Cacti to do the job via a http get on http://192.168.1.1:81/stats.txt

    Greetz,
    Vector


Similar Threads

  1. Real time clock with Oleg's firmware
    By hugo in forum WL-HDD Custom Development
    Replies: 56
    Last Post: 21-04-2009, 09:20
  2. The value of tuning retry parameters in real-world applications
    By -=thrasher=- in forum WL-500g Custom Development
    Replies: 1
    Last Post: 12-01-2006, 15:48
  3. Wan --> Wireless Bandwidth
    By hplus in forum WL-500g Q&A
    Replies: 16
    Last Post: 04-05-2005, 17:24
  4. Replies: 1
    Last Post: 17-02-2005, 08:22
  5. FTP with real administration
    By gladiator in forum WL-HDD Q&A
    Replies: 3
    Last Post: 28-01-2005, 16:38

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •