get connected clients via snmp for virtual interface

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
velde
DD-WRT Novice


Joined: 03 Jul 2012
Posts: 2

PostPosted: Tue Jul 03, 2012 12:12    Post subject: get connected clients via snmp for virtual interface Reply with quote
Hi there,

we are running DD-WRT v24-sp2 (07/21/09) std (SVN revision 12533) since years without problems Smile

DD-WRT serves two wireless clouds (two SSIDs), one on wl0 (pysical interface, bridged to br0 with vlan id 2) and one on wl0.1 (virtual interface, bridged to br1 with vlan id 3).

Now we have a cacti server for monitoring our infrastructure and I want to monitor the connected wireless clients.

I can monitor the connected clients on the physical interface (with cacti plugin from odmon) but not the clients connected to the virtual interface. I understand that odmond plugin queries a certain OID (as under http://www.dd-wrt.com/wiki/index.php/SNMP#Known_OID.C2.B4s_via_SNMP).

With a manual snmpwalk on this subtree I also get just the clients connected to the physical interface:

Code:
snmpwalk -v2c -c community 1.2.3.4 .1.3.6.1.4.1.2021.255.3.54.1.3.32.1.1
UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.1.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.1.2 = INTEGER: 2


(I attached a screenshot from the web gui with 8 connected clients for comparison)

A complete snmpwalk did not show any values to me that could refer to the virtual interface.

To cut a long story short: is it possible to get all clients monitored connected to both interfaces?

Thanks and regards
velde



wireless_clients..png
 Description:
connected wireless clients on web gui
 Filesize:  38.35 KB
 Viewed:  14497 Time(s)

wireless_clients..png


Sponsor
Olivier Nicole
DD-WRT Novice


Joined: 31 Oct 2012
Posts: 7

PostPosted: Tue Nov 06, 2012 5:00    Post subject: Re: get connected clients via snmp for virtual interface Reply with quote
Hi,

When you SNMP access to the OID 1.2.3.4 .1.3.6.1.4.1.2021.255 it runs a script on your AP. This script is /etc/wl_snmpd.sh and return the list of clients for the first interface only (actually for interface bound to wl0)
(eventually this script also has a logic flaw).

I have modified the script to give results for all the interfaces: eth1, eth2, wl0.1, wl0.2,..., wl1.1, wl1.2,... (actually for 'nvram show|grep ifname|grep wl[01]').

The script returns something like:

Code:
snmpwalk -v 1 -c XXXX wifi4 .1.3.6.1.4.1.2021.255
UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.0.1 = INTEGER: 6
UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.1.1 = INTEGER: 5
UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.1.2 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.1.3 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.1.4 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.1.5 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.1.6 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.2.1 = STRING: "eth1"
UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.2.2 = STRING: "eth2"
UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.2.3 = STRING: "wl0.1"
UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.2.4 = STRING: "wl1.1"
UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.2.5 = STRING: "wl0.2"
UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.2.6 = STRING: "wl1.2"
UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.3.1 = STRING: "AIT-CSIM"
UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.3.2 = STRING: "AIT-CSIM"
UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.3.3 = STRING: "AIT-NON-CSIM"
UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.3.4 = STRING: "AIT-NON-CSIM"
UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.3.5 = STRING: "eduroam"
UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.3.6 = STRING: "eduroam"
UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.4.1 = Hex-STRING: XX XX XX 7B 51 3F
UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.4.2 = Hex-STRING: XX XX XX 0C 4E EE
UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.4.3 = Hex-STRING: XX XX XX 38 06 AF

... followed by signal level and SNR like the original script.

First line: UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.0.1 is the number of interfaces.

Six next lines: UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.1.1 to 6 is the number of clients per interface

Six next lines: UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.2.1 to 6 is the name of the interface

Six next lines: UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.1.1 to 6 is the SSID of the interface

Following are the MAC addresses of the clients, the i first lines for the first interface, the j next lines for the second interface, etc. same for the SNR level.

To run the script, you need some storage on your AP (I use JFFS2).

1) save the attached script into /jffs/snmpd/wl_snmpd.sh (note the change in extension)
2) copy /var/snmp/snmpd.conf into /jffs/snmpd
3) modify the last line of /jffs/snmpd/snmpd.conf to point to the script /jffs/snmpd/wl_snmpd.sh
4) disable SNMP on the service page of the GUI
5) add "snmpd -c /jffs/snmpd/snmpd.conf" in the startup commands in the GUI
6) reboot

That should do it.

Note that all the clients for all the interfaces are in the same node of the MIB tree, as I don't need that information, I did not take time to change the script to add one more level.

If you are only interested by the MAC addresses, they are in the OID UCD-SNMP-MIB::ucdavis.255.3.54.1.3.32.1.4.1 and folowing, like in the original script.

Enjoy,

Olivier



wl_snmpd.txt
 Description:

Download
 Filename:  wl_snmpd.txt
 Filesize:  4.51 KB
 Downloaded:  1136 Time(s)

crashfly
DD-WRT Guru


Joined: 24 Feb 2009
Posts: 2026
Location: Sol System > Earth > USA > Arkansas

PostPosted: Tue Nov 06, 2012 5:37    Post subject: Reply with quote
@Olivier Nicole

Since this appears to be a bug with the DD-WRT firmware, have you posted a bug report to the timelime (http://svn.dd-wrt.com:8000/timeline)? If not, it would be useful to let the developers know.

_________________
E3000 22200M KongVPN K26
WRT600n v1.1 refirb mega 18767 BS K24 NEWD2 [not used]
WRT54G v2 16214 BS K24 [access point]

Try Dropbox for syncing files - get 2.5gb online for free by signing up.

Read! Peacock thread
*PLEASE* upgrade PAST v24SP1 or no support.
velde
DD-WRT Novice


Joined: 03 Jul 2012
Posts: 2

PostPosted: Tue Nov 06, 2012 12:30    Post subject: Reply with quote
Thanks a lot Olivier!

I will give it a try when I will find some time for it.

Regards
velde
Olivier Nicole
DD-WRT Novice


Joined: 31 Oct 2012
Posts: 7

PostPosted: Wed Nov 07, 2012 4:33    Post subject: Reply with quote
@crashfly

crashfly wrote:
@Olivier Nicole

Since this appears to be a bug with the DD-WRT firmware, have you posted a bug report to the timelime (http://svn.dd-wrt.com:8000/timeline)? If not, it would be useful to let the developers know.


I posted a bug to Mantis, following the link at the top of the forum page: http://downloads.dd-wrt.com/dd-wrtv2/bugtracker/view.php?id=4348

I will post to timeline too.

Olivier
cookerrr
DD-WRT Novice


Joined: 10 Nov 2016
Posts: 2

PostPosted: Thu Nov 10, 2016 14:49    Post subject: Reply with quote
Sorry to resurrect a really old thread but I seem to be running into this issue with snmp. I'm using snmp for a presence detection script and have a router with both a 2.4 and 5 ghzs radio, so hence wl0 and wl1 interfaces. When I run an snmp walk to detect mac addresses of connected clients it only returns clients connected to wl0 and nothing connected to wl1. Was this bug ever fixed, or am I missing something with in the snmp oid's. The documentation on this seems to be old for ddwrt. The command I use to get the current mac address's is...

snmpwalk -v2c -c public 192.168.27.4 1.3.6.1.4.1.2021.255.3.54.1.3.32.1.4

Should I be using a different oid or is there another one I can't find that holds the addresses of wl1?

Thanks!
cytec
DD-WRT Novice


Joined: 10 Aug 2008
Posts: 16

PostPosted: Mon Feb 19, 2018 22:41    Post subject: Reply with quote
Seeing the same problem, SNMP is only showing mac addresses for clients connected to wl0 not the 5ghz wl1. Sad
cookerrr
DD-WRT Novice


Joined: 10 Nov 2016
Posts: 2

PostPosted: Mon Feb 19, 2018 22:56    Post subject: Reply with quote
I never did find a solution to this. Kind of wish a person who knows more about ddwrt devrlopment could chime in about this.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware 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