Wireless Access

Reply
Occasional Contributor I

SNMP get users by AP

Hi,

I want to get the number of users by AP in snmp, but find nothing like this in mibs. My controler is a 7210 with  6.4.4.16_61809 version.

Thanks

Frequent Contributor I

Re: SNMP get users by AP

get the mibs (aruba and standard) for your release, put them in a directory. Install Net-SNMP (ensure you have a working snmpwalk and snmptable)

 

Assumptions: community is "public", controller is "1.2.3.4", snmp community is set on the controller. Below examples are tested on linux, they will mostly work (except for maybe anything with  grep and awk in it) on windows if you install net-snmp for windows.

 

Finally, please do note that a user is not the same as an association, since a single mac address is actually able to create 4 x IPv4 and 2 x IPv6 users in the user table (e.g. a dual stack client would create 2 entries in the user table, but one in the station table)

 

1. dump all the stats for AP in table form, one of the columns is wlanAPNumClients

snmptable -v2c -c public -M. -mALL -O0X 1.2.3.4 wlsxWlanAPStatsTable

 

2. just get the wlanAPNumClients for all APs

 

root@kali-246:/home/mibs/6.5.4.3# snmpwalk -v2c -c public -M. -mALL -O0X 1.2.3.4 wlanAPNumClients
WLSX-WLAN-MIB::wlanAPNumClients[STRING: ac:a3:1e:c5:1e:f4][1][STRING: ac:a3:1e:d1:ef:50] = INTEGER: 1
WLSX-WLAN-MIB::wlanAPNumClients[STRING: ac:a3:1e:c5:1e:f4][1][STRING: ac:a3:1e:d1:ef:51] = INTEGER: 0
WLSX-WLAN-MIB::wlanAPNumClients[STRING: ac:a3:1e:c5:1e:f4][1][STRING: ac:a3:1e:d1:ef:52] = INTEGER: 0
WLSX-WLAN-MIB::wlanAPNumClients[STRING: c8:b5:ad:ce:94:0e][1][STRING: c8:b5:ad:69:40:f0] = INTEGER: 2

for option 2, you need to resolve the wired mac (first mac above) or  BSSIDs back to AP names (second mac above)

 

 

e.g. for 

WLSX-WLAN-MIB::wlanAPNumClients[STRING: c8:b5:ad:ce:94:0e][1][STRING: c8:b5:ad:69:40:f0] = INTEGER: 2

it is AP named 'ap315'

 

root@kali-246:/home/mibs/6.5.4.3# snmpwalk -v2c -c public -M. -mALL -O0X 1.2.3.4 wlanAPName | grep c8:b5:ad:ce:94:0e
WLSX-WLAN-MIB::wlanAPName[STRING: c8:b5:ad:ce:94:0e] = STRING: ap315

 

the above method is the least load on the controller because you are interogating the AP table, but it requires a little more juggling to get the actual AP name (there are various other tables you can use to achieve the same). You need to take the output from wlanAPNumClients and split it up to get a pairing of like ap-wired-mac:num_clients and then resolve the mac. This would be easy to do with perl or python to postprocess the snmpwalk output of the two commands.

 

Alternatively, if users are what you want, you can get them - but in a less friendly way to the controller as the user table is usually much longer than the AP tables

 

snmpwalk -v2c -c public -M. -mALL -O0X 1.2.3.4 nUserApLocation

 

which has output like this:

 

WLSX-USER-MIB::nUserApLocation[STRING: 80:00:0b:45:2e:ff][192.168.1.5] = STRING: ap315
WLSX-USER-MIB::nUserApLocation[STRING: e8:50:8b:0d:68:0d][192.168.1.17] = STRING: ap315
WLSX-USER-MIB::nUserApLocation[STRING: f4:5c:89:97:d2:43][192.168.1.3] = STRING: ap215
WLSX-USER-MIB::nUserApLocation[STRING: f4:5c:89:97:d2:43][192.168.1.4] = STRING: ap215

which can be split up and counted using some more CLI type hackery (note that I have changed the output flag to -Ov to just get the value)

 

snmpwalk -v2c -c public -M. -mALL -Ov 1.2.3.4 nUserApLocation 2>&1 | grep STRING | awk '{print $2}' | uniq -c

      2 ap315
      2 ap215

you may note that above i had a value of 3 from wlanAPNumClients but the above is showing 2 + 2, that is because one of my clients has consumed a second IP and thus a second user.

 

 

 

 

 

 

Search Airheads
cancel
Showing results for 
Search instead for 
Did you mean: