Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polling IPv6 BGP peers fails for Cisco devices with IPv6 peers in VRF, but no IPv6 peers in default VRF #14957

Closed
ajsiersema opened this issue Apr 12, 2023 · 0 comments · Fixed by #14959

Comments

@ajsiersema
Copy link
Contributor

The problem

( related to #14105 , but for IPv6 BGP peers)

If a Cisco device has VRFs defined and IPv6 BGP peers configured in those VRFs, but no IPv6 BGP sessions/peers in the default VRF, a SNMP (v3) walk without context will not find any cbgpPeer2RemoteAs. The code at the top of includes/polling/bgp-peers.inc.php populating $peer_data_check will return an empty Array:

$peer_data_check = snmpwalk_cache_oid($device, 'cbgpPeer2RemoteAs', [], 'CISCO-BGP4-MIB');

This causes the code near line 34 that checks for an empty $peer_data_check to set the device type/class to generic:

        if (empty($peer_data_check)) {
             $peer_data_check = snmpwalk_cache_oid($device, 'bgpPeerRemoteAs', [], 'BGP4-MIB');
             $generic = true;
         }

IPv6 BGP peers will never be polled, because the network OS specific code is skipped due to the if ($generic) { at the top of the checks. The } elseif ($device['os_group'] == 'cisco') { further below will never execute, and instead of using the CISCO-BGP4-MIB, the code will use the default BGP4-MIB, which won't find the IPv6 peers.

Output of ./validate.php

===========================================
Component | Version
--------- | -------
LibreNMS  | 23.4.0 (2023-04-07T01:52:52+02:00)
DB Schema | 2023_03_14_130653_migrate_empty_user_funcs_to_null (249)
PHP       | 8.2.4
Python    | 3.9.14
Database  | MariaDB 10.5.16-MariaDB
RRDTool   | 1.7.2
SNMP      | 5.9.1
===========================================

[OK]    Composer Version: 2.5.4
[OK]    Dependencies up-to-date.
[OK]    Database connection successful
[OK]    Database Schema is current
[OK]    SQL Server meets minimum requirements
[OK]    lower_case_table_names is enabled
[OK]    MySQL engine is optimal
[OK]    Database and column collations are correct
[OK]    Database schema correct
[OK]    MySQl and PHP time match
[OK]    Distributed Polling setting is enabled globally
[OK]    Connected to rrdcached
[OK]    Active pollers found
[OK]    Dispatcher Service is enabled
[OK]    Locks are functional
[OK]    No python wrapper pollers found
[OK]    Redis is functional
[OK]    rrdtool version ok
[OK]    Connected to rrdcached
[WARN]  Your local git contains modified files, this could prevent automatic updates.
        [FIX]: 
        You can fix this with ./scripts/github-remove
        Modified Files:
         includes/polling/bgp-peers.inc.php

What was the last working version of LibreNMS?

No response

Anything in the logs that might be useful for us?

No response

ajsiersema added a commit to ajsiersema/librenms that referenced this issue Apr 12, 2023
ajsiersema added a commit to ajsiersema/librenms that referenced this issue Apr 17, 2023
PipoCanaja pushed a commit that referenced this issue May 15, 2023
* Fixes #14957 missing IPv6 BGP peers

* Limit to NX-OS and IOS-XR

* Check for actual VRF since count(getVrfContexts) always > 0

* argh, fix last minute nervous finger superfluous space

* removed redundant count()
TheMysteriousX pushed a commit to TheMysteriousX/librenms that referenced this issue Aug 9, 2023
* Fixes librenms#14957 missing IPv6 BGP peers

* Limit to NX-OS and IOS-XR

* Check for actual VRF since count(getVrfContexts) always > 0

* argh, fix last minute nervous finger superfluous space

* removed redundant count()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant