View previous topic :: View next topic |
Author |
Message |
aidos n00b
Joined: 21 Nov 2005 Posts: 4
|
Posted: Sun Feb 19, 2006 2:16 am Post subject: How to get instantaneous download/upload speed? |
|
|
Hi everyone,
I recently decided I was gonna hack my router firmware (a Netgear DG834G that runs linux, kernel 2.4) to add a page where I could see the upload and dowload speed of everyone on the network... but I realised I don't know of any decent way to get those!
A friend of mine suggested a very ugly hack involving running iptables -nvxL with serious grep'ing and awk'ing, a sleep 5, doing step 1 again, substracting and dividing and tada, we have the rates.
I really don't like that solution because it works on his box, but not on the router, or at least not without tweaking.
Any safer ideas? like a magic getdownloadrateforip IP? Any ideas welcome, though if kernel recompilation could be avoided, I would be grateful, the less I tamper with the router the more likely it will keep on working!
thanks for any tips! |
|
Back to top |
|
|
yabbadabbadont Advocate
Joined: 14 Mar 2003 Posts: 4791 Location: 2 exits past crazy
|
Posted: Sun Feb 19, 2006 3:17 am Post subject: |
|
|
Take a look at the source code for gkrellm2 or torsmo or conky or any one of the dozens of programs that already display the information for which you are looking. Assuming you can find the part of the code that does it, it should give you some ideas on how to implement it yourself. _________________
Bones McCracker wrote: | On the other hand, regex is popular with the ladies. |
|
|
Back to top |
|
|
aidos n00b
Joined: 21 Nov 2005 Posts: 4
|
Posted: Sun Feb 19, 2006 1:07 pm Post subject: |
|
|
I had a look at all the programs' source you mentionned and well, the problem is, they only retrieve stats for the whole interface, not per user. So i guess i'll have to use iptables to set up rules to distinguish between users.
thanks though |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|