Access

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
thunderhead
DD-WRT User


Joined: 11 Nov 2017
Posts: 150

PostPosted: Sun Oct 07, 2018 11:55    Post subject: Access Reply with quote
Is it possible to access the info in the radio status page from the shell on dd-wrt? For example, the "wireless packet info" section:

* received (rx) (good and errors)
* transmitted (tx) (good and errors)
Sponsor
thunderhead
DD-WRT User


Joined: 11 Nov 2017
Posts: 150

PostPosted: Sun Oct 07, 2018 13:55    Post subject: Reply with quote
Found it: /proc/net/dev

Wrote a little script to mirror the status page (code below). You need to have your ssh key added to the DD-WRT router for this to work without user input

Example:
Code:
% show-stats
DD-WRT v3.0-r36070M kongac (c) 2018 NewMedia-NET GmbH
Release: 05/31/18

Wireless Packet Info for wl0 (2.4 GHz)
   Received (RX)    : 20,258,498 OK, 0 errors
   Transmitted (TX) : 35,532,511 OK, 6,858 errors

Wireless Packet Info for wl1 (5.x GHz)
   Received (RX)    : 91,372,460 OK, 0 errors
   Transmitted (TX) : 217,533,801 OK, 2,976 errors




Code:
Code:

#!/bin/bash
FULL=/tmp/stats
SELECT=/tmp/use

# generate
ssh root@192.168.1.1 cat /proc/net/dev > $FULL

# grab
[[ -f $FULL ]] || scp root@192.168.1.1:$FULL $FULL

# process
awk '/:/ { print($1,$3,$4,$11,$12 ) }' $FULL > $SELECT

two() {
   RX1=$(grep eth1 $SELECT | awk '{ printf("%'"'"'d\n",$2); }')
   RE1=$(grep eth1 $SELECT | awk '{ printf("%'"'"'d\n",$3); }')
   TX1=$(grep eth1 $SELECT | awk '{ printf("%'"'"'d\n",$4); }')
   TE1=$(grep eth1 $SELECT | awk '{ printf("%'"'"'d\n",$5); }')

   echo
   echo "Wireless Packet Info for wl0 (2.4 GHz)"
   echo "   Received (RX)    : $RX1 OK, $RE1 errors"
   echo "   Transmitted (TX) : $TX1 OK, $TE1 errors"
}

five() {
   RX0=$(grep eth2 $SELECT | awk '{ printf("%'"'"'d\n",$2); }')
   RE0=$(grep eth2 $SELECT | awk '{ printf("%'"'"'d\n",$3); }')
   TX0=$(grep eth2 $SELECT | awk '{ printf("%'"'"'d\n",$4); }')
   TE0=$(grep eth2 $SELECT | awk '{ printf("%'"'"'d\n",$5); }')
   echo
   echo "Wireless Packet Info for wl1 (5.x GHz)"
   echo "   Received (RX)    : $RX0 OK, $RE0 errors"
   echo "   Transmitted (TX) : $TX0 OK, $TE0 errors"
}

two
five
rm $FULL $SELECT
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT 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