BGP sessions under a VRF on Cisco IOS XR

Hi all

I’ve been using librenms for a while but I’ve noticed that bgp sessions under a vrf are not discovered and I have no idea if I can add them manually.

Any ideas?

Hi,
You need to create SNMP vrf context on IOSXR to monitor it, check example fe here

Creating SNMP contexts does give you access to BGP peer information within a VRF, however it’s my understanding that librenms doesn’t support polling data from multiple communities on a single device (same issue with the Nokia ISAM mentioned in Multiple snmp communities per device)

In case of vrf you usually need to poll different ip address, so polling by sysName not connected here.
Create additional device and mark it as dependent on grt polling sysName, not super fancy but solid solution.

But librenms discovers all ip addresses associated with device so its not letting me add a device with another IP address on the device. Any idea?

You can force add a device to librenms and it’ll ignore the duplicate sysname (“addhost -f” from the CLI, or similar from the web interface). As zombah mentioned it’s not a super clean solution, but it does seem to work. On my IOS-XR routers it discovers all interfaces and BGP sessions, associated with the specific VRF. Interfaces in other VRF’s, and GRT, are not discovered/polled in the second instance. My usecase is polling BGP sessions for the “internet” VRF and I created the SNMP context, a loopback in VRF internet and added a DNS name, internet. to poll. Also set the second device to depend on the primary device, as suggested by zombah