Posted: Tue Jul 03, 2012 12:12 Post subject: get connected clients via snmp for virtual interface
Hi there,
we are running DD-WRT v24-sp2 (07/21/09) std (SVN revision 12533) since years without problems
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:
Posted: Tue Nov 06, 2012 5:00 Post subject: Re: get connected clients via snmp for virtual interface
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.
Joined: 24 Feb 2009 Posts: 2026 Location: Sol System > Earth > USA > Arkansas
Posted: Tue Nov 06, 2012 5:37 Post subject:
@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.
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.
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?