*This is a physical port ifIndex example*

ifAdminStatus{ifAlias="Device; Device 
(DEVICE)",ifDescr="GigabitEthernet1/12",ifIndex="12",ifName="Gi1/12"} 1


*1. dot1dBasePortIfIndex is an equivalent of ifIndex but dot1dBasePort is 
not. dot1dBasePort is used to get the MAC address. *

dot1dBasePortIfIndex{dot1dBasePort="12"} 12  - *This won't always be the 
same number*

*2. I get the MAC address and port pair from this*

dot1dTpFdbPort{dot1dTpFdbAddress="11:E0:E4:66:5E:11"} 12


*3.  I get the MAC address and IP pair from this. But 
the ipNetToMediaIfIndex is a VLAN not a physical port. *

ipNetToMediaPhysAddress{ipNetToMediaIfIndex="28",ipNetToMediaNetAddress="
10.10.1.33",ipNetToMediaPhysAddress="11:E0:E4:66:5E:11"} 1



On Thursday, July 18, 2024 at 2:42:10 PM UTC-4 Brian Candler wrote:

> > The challenge I am having is using promql to join the data so I can show 
> the IP associated with the MAC address on the physical port. 
>
> Can you show some examples of the metrics you're trying to join?
>
> On Thursday 18 July 2024 at 18:48:35 UTC+1 Matthew Koch wrote:
>
>> I am working on a project to gather the MAC address and IP which is on a 
>> specific port on a network switch. I've been able to gather this 
>> information with the below SNMP config but the challenge is the MAC address 
>> comes back against the physical port index and the IPs come back against 
>> the VLANs index which is expected. The challenge I am having is using 
>> promql to join the data so I can show the IP associated with the MAC 
>> address on the physical port. 
>>
>>  walk:
>>     - 1.3.6.1.2.1.17.1.4.1
>>     - 1.3.6.1.2.1.17.4.3.1
>>     - 1.3.6.1.2.1.4.22.1
>>     - 1.3.6.1.2.1.4.35.1
>>     metrics:
>>     - name: dot1dBasePortIfIndex
>>       oid: 1.3.6.1.2.1.17.1.4.1.2
>>       type: gauge
>>       help: The value of the instance of the ifIndex object, defined in 
>> MIB-II, for
>>         the interface corresponding to this port. - 1.3.6.1.2.1.17.1.4.1.2
>>       indexes:
>>       - labelname: dot1dBasePort
>>         type: gauge
>>     - name: dot1dTpFdbPort
>>       oid: 1.3.6.1.2.1.17.4.3.1.2
>>       type: gauge
>>       help: Either the value '0', or the port number of the port on which 
>> a frame
>>         having a source address equal to the value of the corresponding 
>> instance of
>>         dot1dTpFdbAddress has been seen - 1.3.6.1.2.1.17.4.3.1.2
>>       indexes:
>>       - labelname: dot1dTpFdbAddress
>>         type: PhysAddress48
>>         fixed_size: 6
>>     - name: dot1dTpFdbStatus
>>       oid: 1.3.6.1.2.1.17.4.3.1.3
>>       type: EnumAsInfo
>>       help: The status of this entry - 1.3.6.1.2.1.17.4.3.1.3
>>       indexes:
>>       - labelname: dot1dTpFdbAddress
>>         type: PhysAddress48
>>         fixed_size: 6
>>       enum_values:
>>         1: other
>>         2: invalid
>>         3: learned
>>         4: self
>>         5: mgmt
>>     - name: ipNetToMediaPhysAddress
>>       oid: 1.3.6.1.2.1.4.22.1.2
>>       type: PhysAddress48
>>       help: ' - 1.3.6.1.2.1.4.22.1.2'
>>       indexes:
>>       - labelname: ipNetToMediaIfIndex
>>         type: gauge
>>       - labelname: ipNetToMediaNetAddress
>>         type: InetAddressIPv4
>>     - name: ipNetToMediaType
>>       oid: 1.3.6.1.2.1.4.22.1.4
>>       type: EnumAsInfo
>>       help: ' - 1.3.6.1.2.1.4.22.1.4'
>>       indexes:
>>       - labelname: ipNetToMediaIfIndex
>>         type: gauge
>>       - labelname: ipNetToMediaNetAddress
>>         type: InetAddressIPv4
>>       enum_values:
>>         1: other
>>         2: invalid
>>         3: dynamic
>>         4: static
>>     - name: ipNetToPhysicalIfIndex
>>       oid: 1.3.6.1.2.1.4.35.1.1
>>       type: gauge
>>       help: The index value that uniquely identifies the interface to 
>> which this entry
>>         is applicable - 1.3.6.1.2.1.4.35.1.1
>>       indexes:
>>       - labelname: ipNetToPhysicalIfIndex
>>         type: gauge
>>       - labelname: ipNetToPhysicalNetAddress
>>         type: InetAddress
>>     - name: ipNetToPhysicalNetAddressType
>>       oid: 1.3.6.1.2.1.4.35.1.2
>>       type: EnumAsInfo
>>       help: The type of ipNetToPhysicalNetAddress. - 1.3.6.1.2.1.4.35.1.2
>>       indexes:
>>       - labelname: ipNetToPhysicalIfIndex
>>         type: gauge
>>       - labelname: ipNetToPhysicalNetAddress
>>         type: InetAddress
>>       enum_values:
>>         0: unknown
>>         1: ipv4
>>         2: ipv6
>>         3: ipv4z
>>         4: ipv6z
>>         16: dns
>>     - name: ipNetToPhysicalNetAddress
>>       oid: 1.3.6.1.2.1.4.35.1.3
>>       type: InetAddress
>>       help: The IP Address corresponding to the media-dependent 
>> `physical' address
>>         - 1.3.6.1.2.1.4.35.1.3
>>       indexes:
>>       - labelname: ipNetToPhysicalIfIndex
>>         type: gauge
>>       - labelname: ipNetToPhysicalNetAddress
>>         type: InetAddress
>>     - name: ipNetToPhysicalPhysAddress
>>       oid: 1.3.6.1.2.1.4.35.1.4
>>       type: PhysAddress48
>>       help: The media-dependent `physical' address - 1.3.6.1.2.1.4.35.1.4
>>       indexes:
>>       - labelname: ipNetToPhysicalIfIndex
>>         type: gauge
>>       - labelname: ipNetToPhysicalNetAddress
>>         type: InetAddress
>>     - name: ipNetToPhysicalLastUpdated
>>       oid: 1.3.6.1.2.1.4.35.1.5
>>       type: gauge
>>       help: The value of sysUpTime at the time this entry was last 
>> updated - 1.3.6.1.2.1.4.35.1.5
>>       indexes:
>>       - labelname: ipNetToPhysicalIfIndex
>>         type: gauge
>>       - labelname: ipNetToPhysicalNetAddress
>>         type: InetAddress
>>     - name: ipNetToPhysicalType
>>       oid: 1.3.6.1.2.1.4.35.1.6
>>       type: EnumAsInfo
>>       help: The type of mapping - 1.3.6.1.2.1.4.35.1.6
>>       indexes:
>>       - labelname: ipNetToPhysicalIfIndex
>>         type: gauge
>>       - labelname: ipNetToPhysicalNetAddress
>>         type: InetAddress
>>       enum_values:
>>         1: other
>>         2: invalid
>>         3: dynamic
>>         4: static
>>         5: local
>>     - name: ipNetToPhysicalState
>>       oid: 1.3.6.1.2.1.4.35.1.7
>>       type: EnumAsInfo
>>       help: The Neighbor Unreachability Detection state for the interface 
>> when the
>>         address mapping in this entry is used - 1.3.6.1.2.1.4.35.1.7
>>       indexes:
>>       - labelname: ipNetToPhysicalIfIndex
>>         type: gauge
>>       - labelname: ipNetToPhysicalNetAddress
>>         type: InetAddress
>>       enum_values:
>>         1: reachable
>>         2: stale
>>         3: delay
>>         4: probe
>>         5: invalid
>>         6: unknown
>>         7: incomplete
>>     - name: ipNetToPhysicalRowStatus
>>       oid: 1.3.6.1.2.1.4.35.1.8
>>       type: EnumAsInfo
>>       help: The status of this conceptual row - 1.3.6.1.2.1.4.35.1.8
>>       indexes:
>>       - labelname: ipNetToPhysicalIfIndex
>>         type: gauge
>>       - labelname: ipNetToPhysicalNetAddress
>>         type: InetAddress
>>       enum_values:
>>         1: active
>>         2: notInService
>>         3: notReady
>>         4: createAndGo
>>         5: createAndWait
>>         6: destroy
>>
>

-- 
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/7cfc53e6-bc7d-4fdf-9d32-2735cceef10en%40googlegroups.com.

Reply via email to