I recently realised that newly added switches were not being auto-discovered by LLDP any more, but auto-discovery via CDP is still working. Since LLDP and CDP are bundled together under the ‘XDP’ discovery method I’m a bit baffled why LLDP seems to have given up.
Our switches do not have DNS records so we have discovery_by_ip set to true, and this has been working fine.
We have 3 distributed pollers, using the despatcher service. I have run lnms config:get from the cli on each poller to confirm that settings haven’t somehow drifted on any of them. They all have the correct setting for autodiscovery subnets, xdp discovery enabled, and discovery_by_ip set to true. Validate.php passes on all pollers as well.
Steps to reproduce:
Connect a new switch to one already known to LibreNMS, await discovery or manually run discovery against the existing switch.
When the new switch and the existing one are both Ciscos, and have CDP enabled, I see the following 2 entries in the event log for the existing switch:
- CDP discovery of [new switch’s hostname] failed - check name lookup
- Device [new switch’s IP] autodiscovered through CDP on [existing switch’s IP]
As expected, the new switch then shows up as a newly-added device in LibreNMS.
On non-Cisco switches (or if I disable CDP on the Ciscos), then the event log just says:
- LLDP discovery of [new switch hostname] failed - check name lookup.
The failure of discovery by hostname is expected as these devices don’t have DNS records, but I can’t figure out why discovery doesn’t go on to try discovering the device by IP address with LLDP like it did with CDP.
We definitely have LLDP enabled and working on the switches - If I log on to the CLI of the existing switch and ask it to show its LLDP neighbours, it correctly reports the presence of the new switch, including the correct IP address for the new switch, so I can’t see any reason why discovery by IP wouldn’t happen.
This was definitely working in the past - we have many non-Cisco switches and we definitely didn’t have to add them all in manually! But I can’t think of any reason why CDP autodiscovery would work and LLDP won’t. All suggestions gratefully received!
Discovery.php run against the existing switch: https://p.libren.ms/view/101b0f93
Poller.php run against the existing switch:
https://p.libren.ms/view/36a928ac
Output of validate.php:
Component | Version |
---|---|
LibreNMS | 24.12.0-2-ge86f7cc82 (2024-12-18T15:25:47+00:00) |
DB Schema | 2024_10_20_154356_create_qos_table (310) |
PHP | 8.3.14 |
Python | 3.8.10 |
Database | MariaDB 10.6.20-MariaDB-ubu2004 |
RRDTool | 1.7.2 |
SNMP | 5.8 |
=========================================== |
[OK] Composer Version: 2.8.4
[OK] Dependencies up-to-date.
[OK] Database connection successful
[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] Python wrapper cron entry is not present
[OK] Redis is functional
[OK] rrdtool version ok
[OK] Connected to rrdcached