From 1d53679a64f6ecd3884f62af361d84681a15e00a Mon Sep 17 00:00:00 2001 From: Albert Siersema Date: Sun, 7 Aug 2022 16:22:39 +0200 Subject: [PATCH] fixes #14104 polling BGP peers in non-default VRF (#14105) --- includes/polling/bgp-peers.inc.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/polling/bgp-peers.inc.php b/includes/polling/bgp-peers.inc.php index 7ed2f0fe38..9cfd9134e5 100644 --- a/includes/polling/bgp-peers.inc.php +++ b/includes/polling/bgp-peers.inc.php @@ -48,7 +48,13 @@ if (\LibreNMS\Config::get('enable_bgp')) { echo "Checking BGP peer $peer_ip "; // --- Collect BGP data --- - if (count($peer_data_check) > 0) { + // If a Cisco device has BGP peers in VRF(s), + // but no BGP peers in the default VRF, + // a SNMP (v3) walk without context will not find any + // cbgpPeer2RemoteAs, resulting in empty $peer_data_check. + // Without the or clause, we won't see the VRF BGP peers. + // ($peer_data_check isn't used in the Cisco code path,) + if (count($peer_data_check) > 0 || ($device['os_group'] == 'cisco' && count(DeviceCache::getPrimary()->getVrfContexts()) > 1)) { if ($generic) { echo "\nfallback to default mib";