Dream KillerGraveyard Shift Premium Member join:2002-08-09 Forest Hills, NY |
Tx/Rx rate in MI424wr telnet?I'm graphing a bunch of stuff from the MI424wr in RRD however I can't seem to find where Tx/Rx information is listed in the telnet terminal.
I can see it I log into the router's webgui but it's not saved or printed anywhere. Does the router not calculate this statistic? |
|
Dream Killer |
Nvm, I figured how to do it through the COUNTER DST so it derives speed from Tx/Rx amount. |
|
|
to Dream Killer
I've been meaning to do this, mind sharing some of your rrd scripts? |
|
Dream KillerGraveyard Shift Premium Member join:2002-08-09 Forest Hills, NY |
When I complete it I'll share it here. I'm still having a lot of problems sorting out what value is WAN upload from the router. "Sent Bytes" under "Broadband Connection" is obviously wrong. |
|
watice join:2008-11-01 New York, NY |
watice
Member
2013-Feb-10 4:15 am
apologize if this has been asked before somewhere, but is there a way to get this data via snmp? same router, a Rev I, but I see no such options in the webgui |
|
|
No SNMP support in the router. |
|
Dream KillerGraveyard Shift Premium Member join:2002-08-09 Forest Hills, NY 1 edit |
As promised: It's a bit brute forcish in scripting as I'm not very good at it. Someone can probably clean up the script so it's more understandable but I can try to help if anyone's having trouble. |
|
your moderator at work
hidden :
|
1 recommendation |
to Dream Killer
Re: Tx/Rx rate in MI424wr telnet?I did something similar for a guy running a westell router (i forget the model) Just used ifconfig output (which reset every 4 GB with MRTG which expected this behavior). Had a stand-alone shell script that just dumped some info to a text file and parsed that: vz_ifconfig.sh: #!/bin/sh
/usr/bin/expect << EOF
set timeout 20
spawn /usr/bin/telnet targetip targetport
expect "Username: "
send "bandwidth\r"
expect "Password: "
send "thepassword\r"
expect "Wireless Broadband Router> "
send "system shell\r"
expect "/ #"
send "ifconfig\r"
expect "/ #"
send "uptime\r"
expect "/ #"
send "exit\r"
expect "Wireless Broadband Router> "
send "exit\r"
exit
EOF
And the script that MRTG called: vz_bytes.sh: #!/bin/sh
tmp=/stats/vz_ifconfig.txt
/stats/vz_ifconfig.sh > $tmp
bytes=`cat $tmp | grep -A6 eth1 | tail -n 1 | /usr/bin/awk '{print $2" "$6}' | /usr/bin/awk -F "bytes:" '{print $2 $3}'`
rx=`echo $bytes | /usr/bin/awk '{print $1}'`
tx=`echo $bytes | /usr/bin/awk '{print $2}'`
uptime=`cat $tmp | grep load | /usr/bin/awk -F "up " '{print $2}' | /usr/bin/awk -F ", load" '{print $1}'`
echo $rx
echo $tx
echo $uptime
echo "Home Network"
|
|
Dream KillerGraveyard Shift Premium Member join:2002-08-09 Forest Hills, NY 1 edit |
ooh, that works too, and the mi424wr has 64-bit counters (i'm seeing a couple terabytes when i pull mine up). though "qos utilization" already keeps track of the speeds, no calculation needed, of all connections so all i had to do was pull the columns out and add them up for the total rate.
EDIT: though i have to rebuild my RRD/RRAs, i think your script that uses expect works a lot better since the counters on ifconfig seems more accurate than the qos engine on the router. some packets traverse the firewall through fastpath and it doesnt get counted along with the rest at all.
thanks! |
|
|
ah I guess the newer ones have 64-bit counters which is definitely nice considering you can't even record speeds more than 117 megabits or something (forget what it is) if your doing a 5 minute interval on 32-bit counters. |
|