Discovery.php doesn't get BGP info on one of Cisco A9K

When i run ./discovery.php -d -h without modules (just general discovery) or auto-discovery running, i got the issue: “no BGP on host” and don’t get BGP info from router:

But when i run ./discovery.php -d -h -m bgp-peers all BGP info successful discovered:


Until the next re-discovery.

Please help fix it, i think it’s some issue on LibreNMS and not on a router

Did you try enabling bgp-peers in the module settings of the device ? What you describe seems to be a disabled module (and when you run it manually, you force it).

You can also do this generally for the OS in the config.php file.

I’m already enable bgp-peers module in device settings and run re-discovery, but no luck

In the discovery extracts you posted, one device is not replying at all. So LibreNMS cannot discover much. Try to ensure that the device replies to the snmp requests (test it from CLI, doing exactly the same as LibreNMS does).

./discovery.php -h <device> -v -d

will display all the exact SNMP requests.

This is weird:

Load disco module bgp-peers

SNMP['/usr/bin/snmpgetnext' '-v2c' '-c' 'fcc-public-community' '-Oqvn' '-m' 'BGP4-MIB' '-M' '/opt/librenms/mibs:/opt/librenms/mibs/cisco' '' 'bgpLocalAs']

Timeout: No Response from
No BGP on hostPeers :
SQL[DELETE FROM `bgpPeers` WHERE device_id=? AND context_name=? [310,""] 0.75ms]

SQL[DELETE FROM `bgpPeers_cbgp` WHERE device_id=? AND context_name=? [310,""] 0.62ms]

SQL[SELECT DISTINCT context_name FROM bgpPeers WHERE device_id=? [310] 0.79ms]

>> Runtime for discovery module 'bgp-peers': 6.0260 seconds with 6424 bytes
>> SNMP: [1/6.02s] MySQL: [2/0.00s] RRD: [0/0.00s]
#### Unload disco module bgp-peers ####

But when i run command from cli it’s OK:
/usr/bin/snmpgetnext -v2c -c fcc-public-community -Oqvn -m BGP4-MIB -M /opt/librenms/mibs:/opt/librenms/mibs/cisco bgpLocalAs

I would suggest a wireshark/tcpdump to ensure that the request is indeed built the same way. Probably a dest DNS difference or source ip address difference. Community will also appear cleartext so you can compare.