Problem with CDP auto-discovery

Hi!

I’ve recently installed LibreNMS and have slowly started adding a bit over 100 devices so far using auto-discovery but I’ve run into a problem with some switches not being able to be added despite DNS (both forward and reverse) being ok.

Discovery fails with the “CDP discovery of ‘(truncated)FQDN’ failed - Check name lookup” error-message in the eventlog.
The IP-networks in question are defined in the config.php.

So far I’ve noticed this on Cisco Catalyst switches, and the problem seems to me to be caused by the fact that these devices announce their CDP devicename as an FQDN if for example “ip domain-name domain.tld” is configured.
In my case this causes the devices to announce themselves as hostname.subdomain.domain.tld and in some cases that makes the devicenames longer than 40 characters which then get truncated and thus unable to be resolved since it’s an incomplete/invalid FQDN.

A possible solution to this would be to ignore the FQDN and only lookup the hostname on CDP devices with devicenames = 40 characters that are unable to be resolved.
Or is there something I’ve missed since I am fairly new to LibreNMS?

I guess using $config['discovery_by_ip'] = true; could be another workaround, if I enable this are the devices still added with the name (from sysname or DNS) or will I just get a big list of devices with IP-addresses as “names”?

Does “discovery_by_ip” respect the $config['nets'][] IP-ranges?
I assume so but confirmation would be nice. :slight_smile: