How to disable LLDP autodiscovery but not LLDP discovery?

Hello.

I have an issue, I would like to have my LLDP discovered/polled correctly but I don’t want LLDP autodiscovery (so I won’t want LibreNMS to try to automatically add neighbors to the system), the issue is that then I set $config['autodiscovery.xdp'] = true; I have both discovery and autodiscovery enabled and when I set $config['autodiscovery.xdp'] = false; both are completely gone (after the next discovery, the LLDP tabs are gone from the devices)

Basically right now it’s spamming my eventlogs of LLDP discovery of xxxx failed - Check name lookup because it’s trying to add everything

How can I achieve this ?

Thanks

It works on my side

$config[‘autodiscovery’] = false;
$config[‘autodiscovery’][‘xdp’] = true;

Thanks, I will give it a try :slight_smile:

No luck so far, it’s still generating a lot of eventlogs.
Also I don’t see a autodiscovery key in the Global Config page, are you sure this one exists ?

I’ve checked the source code and looks like there are no way to actually disable autodiscovery without disabling the LLDP discovery itself ?
I’ve take a look at the discovery-protocols.inc.php and basically if autodiscovery.xdp is false it will not discover anything, it looks like there are some confusion between discovery and autodiscovery (adding devices we don’t know from data we get from xDP, BGP, etc…) ?

Auto discovery can be disabled by defining the networks in which auto discovery is allowed. If you allow none, then discovery should be turned off.
https://docs.librenms.org/Extensions/Auto-Discovery/

I tried that to disable it completely but no luck so far :

$config['nets'][] = '255.255.255.255/32';

But I suppose it’s trying to resolve it first as the error is check name lookup ?

Try this :

$config['nets'] = [] ;

This way you ensure that no more IP will match an empty array. And see how it goes.

I think the issue is that it’s trying to resolve the DNS before that, but I don’t see any way to disable this ?

I was also trying to do this, i have the following config but still getting the discovery messages.

$config[‘nets’] = [];
$config[‘autodiscovery’] = false;
$config[‘autodiscovery’][‘xdp’] = true;

Global config page in webui does not contain all the settings

Your config is correct.

DNS resolving messages in eventlog category discovery does not mean it does the device autocreation. It just means the system tries to determine the IP to check wether it is in $config[‘nets’] = [];

So I’m guessing there is no way to remove that message as of now? The only reason i ask is because i have over 200k of them in my event log and it’s kind of mucking it up. I was hoping there was a config option like ignore_mount where it would filter event log messages based on a regex. No such luck.

Actually i just looked through the code, and like the other poster said, auto-discovery and discovery of the cdp/lldp table are all mashed together, it seems like this should be separated somewhat in the future. I think this would work just hacking together real quick, i haven’t tested it at all…

includes/discovery/discovery-protocols.inc.php

add Another config option to bypass the discovery section. Make config option autodiscovery.add false to bypass.

        if (config::get('autodiscovery.add' === True) {
        
        if (!$remote_device_id &&
            !can_skip_discovery($cdp['cdpCacheDeviceId'], $cdp['cdpCacheVersion'], $cdp['cdpCachePlatform'])
        ) {
            $remote_device_id = discover_new_device($cdp['cdpCacheDeviceId'], $device, 'CDP', $interface);
            if (!$remote_device_id && Config::get('discovery_by_ip', false)) {
                $remote_device_id = discover_new_device($cdp_ip, $device, 'CDP', $interface);
            }

Reduce $config[‘eventlog_purge’] value

Yeah but that doesn’t really solve the issue, it’s spamming the event log, so if i look at a device that has 48 cdp neighbors i see 48 entries in the event log for this. So no matter how small i make the purge, i’m always going to get spammed with it.

The only to solve it seems to do a pull request :slight_smile:

Indeed it could be interesting to have this kind of configurable toggle to completely disable all autodiscovery (that would affect all discovery protocols then).

For now I frequently purge the database with

DELETE FROM eventlog WHERE message LIKE "LLDP%";

Hello everyone.

I made a PR about that :

2 Likes

Okay i’ve tried everything, and i can’t get this working correctly. I have verified that my autodiscovery.xdp is set to false in both the webgui config and the lnms command.

However i am still getting discovery messages on cisco ip phones.
CDP discovery of SEPAABBCCDDEEFF failed - Check name lookup

In discovery-protocols.inc.php I have no idea why this statement is it’s still evaluating to true.

if (! $remote_device_id &&
    ! can_skip_discovery($cdp['cdpCacheDeviceId'], $cdp['cdpCacheVersion'], $cdp['cdpCachePlatform'] &&
    Config::get('autodiscovery.xdp') === true)

Considering Cisco IP Phone is also ignored by default, and i have autodiscovery.xdp set to false. It doesn’t make any sense. I even reinstalled and still having the issue. I’m not sure what else i can check. Any ideas?

Nevermind i just found it, the Parenthesis are a little off in here, will put a pull request in now.