01-08-2025 10:05 AM
I am trying to monitor BGP peers which are configured under separate VRFs on a Nexus switch, running software version 9.3;
I reviewed the workaround for IOS from this discussion: Monitor BGP sessions on VRFs with XR 4.2 using SNMP - Cisco Community. You would think it should not be that hard to adapt it for NXOS but I am getting nowhere after spending a few hours on it.
I am running NXOS software version 9.3;
I am using snmp v2c
I have also added this config to the nexus switch: snmp-server context example-context vrf example-vrf
I am using the OIDs from the image below.
Here are my snmp walks when I run them against the "example-context":
This snmpwalk does not return any results, so I wonder if my OID is incorrect? I expect it to return the BGP peers.
----------------------- New Test -----------------------
Paessler SNMP Tester - 24.4.102.648 Computername: MGUSINPCDC808 Interface: 10.25.100.232
1/8/2025 11:34:33 AM (7 ms) : Device: 10.10.10.21
1/8/2025 11:34:33 AM (9 ms) : SNMP v2c
1/8/2025 11:34:33 AM (11 ms) : Custom OID 1.3.6.1.2.1.15.3.1
1/8/2025 11:34:33 AM (45 ms) : SNMP Datatype: SNMP_EXCEPTION_NOSUCHOBJECT
1/8/2025 11:34:33 AM (48 ms) : -------
1/8/2025 11:34:33 AM (52 ms) : Value: #N SNMP_EXCEPTION_NOSUCHOBJECT222
1/8/2025 11:34:33 AM (55 ms) : Done
This one returns something, so I know I have SNMP connectivity and my snmp tool works:
----------------------- New Test -----------------------
Paessler SNMP Tester - 24.4.102.648 Computername: MGUSINPCDC808 Interface: 10.25.100.232
1/8/2025 11:34:51 AM (6 ms) : Device: 10.10.10.21
1/8/2025 11:34:51 AM (10 ms) : SNMP v2c
1/8/2025 11:34:51 AM (12 ms) : Custom OID 1.3.6.1.2.1.15.4.0
1/8/2025 11:34:51 AM (47 ms) : SNMP Datatype: ASN_IPADDRESS
1/8/2025 11:34:51 AM (50 ms) : -------
1/8/2025 11:34:51 AM (52 ms) : Value: 172.28.28.55
1/8/2025 11:34:51 AM (54 ms) : Done
01-15-2025 03:26 AM
Hello @Ivaylo Georgiev
It seems like you're trying to monitor BGP peers in a VRF context on a Nexus switch using SNMP, but you're running into issues with the OIDs and the SNMP context configuration.
It seems like you're trying to monitor BGP peers in a VRF context on a Nexus switch using SNMP, but you're running into issues with the OIDs and the SNMP context configuration. Let's break this down and troubleshoot step by step.
SNMP Context for VRFs:
snmp-server context example-context vrf example-vrfThis is correct, and it ensures that SNMP queries using the example-context will retrieve data specific to the example-vrf.
OID for BGP Peers:
Successful SNMP Walk:
Verify BGP Configuration in the VRF:
show ip bgp all summary vrf example-vrfThis will show the BGP peers and their states within the VRF. If there are no active peers, the SNMP walk will not return any results.
Verify SNMP Context:
show running-config | include snmp-server contextConfirm that the context name (example-context) matches what you're using in your SNMP tool.
Test the OID with the Context:
snmpwalk -v2c -c <community> -Cn example-context <switch-ip> 1.3.6.1.2.1.15.3.1If this still returns SNMP_EXCEPTION_NOSUCHOBJECT, it could mean that the OID is not valid in the VRF context or that there are no active BGP peers.
Check for Nexus-Specific MIBs:
Test with a Different OID:
snmpwalk -v2c -c <community> -Cn example-context <switch-ip> 1.3.6.1.2.1.15This will give you an idea of what BGP-related data is accessible via SNMP in the VRF context.
Debug SNMP on the Nexus Switch:
debug snmp packetsMonitor the logs to see if there are any errors or issues with the SNMP requests.
By following these steps, you should be able to identify the root cause of the issue and retrieve the BGP peer information via SNMP. Let me know if you need further assistance!
Hope This Helps!!!
AshSe
Forum Tips:
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide