tweak parsing of lists of regex in config
This commit is contained in:
@@ -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,13 +807,15 @@ 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',
|
||||
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
|
||||
try {
|
||||
|
||||
@@ -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<macsuck_all_vlans>
|
||||
|
||||
@@ -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<ignore_private_nets>
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user