diff --git a/Netdisco/lib/App/Netdisco/Core/Discover.pm b/Netdisco/lib/App/Netdisco/Core/Discover.pm index 590fd8ad..b3448a97 100644 --- a/Netdisco/lib/App/Netdisco/Core/Discover.pm +++ b/Netdisco/lib/App/Netdisco/Core/Discover.pm @@ -198,7 +198,7 @@ sub store_interfaces { next; } - if (scalar grep {$port =~ m/$_/} @{setting('ignore_interfaces') || []}) { + if (scalar grep {$port =~ m/^$_$/} @{setting('ignore_interfaces') || []}) { debug sprintf ' [%s] interfaces - ignoring %s (%s) (config:ignore_interfaces)', $device->ip, $entry, $port; @@ -807,12 +807,14 @@ sub discover_new_neighbors { my $device = get_device($ip); next if $device->in_storage; - my $remote_type_match = setting('discover_no_type'); - if ($remote_type and $remote_type_match - and $remote_type =~ m/$remote_type_match/) { - debug sprintf ' queue - %s, type [%s] excluded by discover_no_type', - $ip, $remote_type; - next; + if ($remote_type) { + if (scalar grep {$remote_type =~ m/$_/} + @{setting('discover_no_type') || []}) { + debug sprintf + ' queue - %s, type [%s] excluded by discover_no_type', + $ip, $remote_type; + next; + } } # could fail if queued job already exists diff --git a/Netdisco/lib/App/Netdisco/Manual/Configuration.pod b/Netdisco/lib/App/Netdisco/Manual/Configuration.pod index 95e210f9..e749b7ce 100644 --- a/Netdisco/lib/App/Netdisco/Manual/Configuration.pod +++ b/Netdisco/lib/App/Netdisco/Manual/Configuration.pod @@ -225,10 +225,14 @@ IPv6). Value: List of Strings. Default: None. -Place a regular expression pattern here to exclude the discovery of certain +Place regular expression patterns here to exclude the discovery of certain devices based on the CDP/LLDP device type information. Good for excluding a whole device class like lightweight access points or IP phones that have CDP -but don't talk SNMP +but don't talk SNMP. For example: + + discover_no_type: + - 'cisco\s+AIR-LAP' + - '(?i)Cisco\s+IP\s+Phone' =head3 C @@ -267,29 +271,28 @@ it. Value: List of Strings. Default: ignore_interfaces: - - EOBC - - unrouted VLAN - - StackPort - - Control Plane Interface - - SPAN (S|R)P Interface - - StackSub - - netflow - - Vlan\d+-mpls layer - - BRI\S+-Bearer Channel - - BRI\S+-Physical - - BRI\S+-Signalling - - Embedded-Service-Engine\d+\/\d+ - - Virtual-Template\d+ - - Virtual-Access\d+ - - (E|T)\d \d\/\d\/\d - - Vlan1 + - 'EOBC' + - 'unrouted VLAN' + - 'StackPort' + - 'Control Plane Interface' + - 'SPAN (S|R)P Interface' + - 'StackSub' + - 'netflow' + - 'Vlan\d+-mpls layer' + - 'BRI\S+-Bearer Channel' + - 'BRI\S+-Physical' + - 'BRI\S+-Signalling' + - 'Embedded-Service-Engine\d+\/\d+' + - 'Virtual-Template\d+' + - 'Virtual-Access\d+' + - '(E|T)\d \d\/\d\/\d' + - 'Vlan1' If present, device ports whose names match fully any of the items in this list will be ignored by the discovery process. Note this may have side effects - connected devices and nodes on those ports -will in turn also not be discovered. Also note that backslashes must be -doubled in the YAML format. +will in turn also not be discovered. =head3 C diff --git a/Netdisco/share/config.yml b/Netdisco/share/config.yml index d77d5e00..cf88dd50 100644 --- a/Netdisco/share/config.yml +++ b/Netdisco/share/config.yml @@ -87,14 +87,14 @@ ignore_interfaces: - 'SPAN (S|R)P Interface' - 'StackSub' - 'netflow' - - 'Vlan\\d+-mpls layer' - - 'BRI\\S+-Bearer Channel' - - 'BRI\\S+-Physical' - - 'BRI\\S+-Signalling' - - 'Embedded-Service-Engine\\d+\\/\\d+' - - 'Virtual-Template\\d+' - - 'Virtual-Access\\d+' - - '(E|T)\\d \\d\\/\\d\\/\\d' + - 'Vlan\d+-mpls layer' + - 'BRI\S+-Bearer Channel' + - 'BRI\S+-Physical' + - 'BRI\S+-Signalling' + - 'Embedded-Service-Engine\d+\/\d+' + - 'Virtual-Template\d+' + - 'Virtual-Access\d+' + - '(E|T)\d \d\/\d\/\d' - 'Vlan1' workers: diff --git a/TODO b/TODO index f6b656d5..32b215b2 100644 --- a/TODO +++ b/TODO @@ -21,7 +21,6 @@ CORE * VRF support * import legacy config file -* list of string settings should use index() DOCS ====