I should also add: if this is a *switch*, it won't necessarily see all its 
connected devices in its ARP table - unless it's running as a router, i.e. 
a pure layer 3 configuration.

To see the connected devices on a layer 2 switch you need the 802.1d bridge 
forwarding table, BRIDGE-MIB::dot1dTpFdbTable (1.3.6.1.2.1.17.4.3), or the 
VLAN-aware multiple tables in Q-BRIDGE-MIB::dot1qFdbTable / dot1qTpFdbTable

On Thursday, 2 November 2023 at 08:07:21 UTC Brian Candler wrote:

> atTable (1.3.6.1.2.1.3.1 
> <https://www.alvestrand.no/objectid/1.3.6.1.2.1.3.1.html>) contains 
> atEntry rows (1.3.6.1.2.1.3.1.1 
> <https://www.alvestrand.no/objectid/1.3.6.1.2.1.3.1.1.html>), each of 
> which has three columns, one of which is atIfIndex (1.3.6.1.2.1.3.1.1.1 
> <https://www.alvestrand.no/objectid/1.3.6.1.2.1.3.1.1.1.html>).  The 
> description of atIfIndex says:
>
> *"The interface on which this entry's equivalence is effective. The 
> interface identified by a particular value of this index is the same 
> interface as identified by the same value of ifIndex." *
>
> Therefore, if you're not seeing this, it's probably a problem with your 
> snmp generator configuration. Can you show your generator.yml, and give an 
> example of the metrics you are getting?
>
> Aside: atTable is ancient and deprecated since 1991 (MIB-II). If your 
> device supports one of the newer MIBs like ipNetToMediaTable 
> (1.3.6.1.2.1.4.22, RFC 1213) or ipNetToPhysicalTable (1.3.6.1.2.1.4.35, RFC 
> 4293), you should use that instead.
>
> Note that these tables contain the MAC addresses of *other* devices on 
> your network. If you want the MAC address *of the interface itself*, then 
> there is ifPhysAddress from the ifTable (which is collected with the 
> out-of-the-box SNMP generator config).
>
> # HELP ifPhysAddress The interface's address at its protocol sub-layer - 
> 1.3.6.1.2.1.2.2.1.6
> # TYPE ifPhysAddress gauge
> ifPhysAddress{ifAlias="",ifDescr="ether1",ifIndex="1",ifName="ether1",ifPhysAddress="00:5A:FF:1C:79:FD"}
>  
> 1
>
> On Wednesday, 1 November 2023 at 20:24:39 UTC Tyler Mace wrote:
>
>> I am using a cisco_wlc switch with snmp-exporter.
>>
>> The SNMP service knows about the connected MAC addresses for each port 
>> (through it's ARP table). Every other field for network metrics uses 
>> ifIndex as an index input. But this index doesn't work for the 
>> atPhysAddress OID. How can I correlate the ifIndex to the atPhysAddress to 
>> dynamically get MAC addresses?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/ae03b5b4-8c5e-4a31-9aa1-572c7a9ddd37n%40googlegroups.com.

Reply via email to