Getting the current up and down bandwidth

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> General Questions
Author Message
w4rp3d
DD-WRT Novice


Joined: 24 Jul 2009
Posts: 4

PostPosted: Wed Mar 30, 2011 13:21    Post subject: Getting the current up and down bandwidth Reply with quote
Hi,
Im trying to grab the current up and down bandwidth, specifically over the LAN, for use in a script. Ive looked all over the wiki and attempted to look though other scripts but ive been unable to find a way to get them. It must be possible as Status_Bandwidth.asp shows and then plots them.

I know you can get it using snmp but that requires a server to pull them, instead i would like the router to simply pass them in a URL parameter to my web server.

Thanks
Sponsor
w4rp3d
DD-WRT Novice


Joined: 24 Jul 2009
Posts: 4

PostPosted: Wed Mar 30, 2011 15:00    Post subject: Reply with quote
O dw, after a couple more hours I found it.

If anyone is interested u can get the amount sent and received by using grep and ifconfig:


RX=`ifconfig br0 | grep "RX bytes:" | cut -d ':' -f2 | cut -d "(" -f1 | tr -d ' '`
TX=`ifconfig br0 | grep "RX bytes:" | cut -d ':' -f3 | cut -d "(" -f1 | tr -d ' '`

If you can get the amount sent then u can get the current by just doing it again and subtracting them
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
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
You can attach files in this forum
You can download files in this forum