Ik now that you can get upload values by doingif you use Wondershaper.Code:wshaper status eth1
There are other users who posted traffic accounting scripts, you might want to check them out.
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 ]
Ik now that you can get upload values by doingif you use Wondershaper.Code:wshaper status eth1
There are other users who posted traffic accounting scripts, you might want to check them out.
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.
cool!
thanks!
[ WL-500G | fw: 1.9.2.7-7f ]
Originally Posted by gwl
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/ .+//'
Nice think, it works.Originally Posted by vector
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
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.
You can get the same results with plain old ifconfigcat /proc/net/dev | grep ":" | sed -re 's/ +/ /g' | sed -re 's/ //' | sed -re 's/: /:/' | sed -re 's/ .+//'
"What's the color of a chameleon put onto a mirror?" - Stewart Brand.
Using DevFS and have giving up on crond (doesn't work don't know why), i'm using the following for my stats collection:Originally Posted by WlanMan
/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