#827 add ignore_interface_types setting
This commit is contained in:
@@ -239,11 +239,18 @@ register_worker({ phase => 'early', driver => 'snmp' }, sub {
|
||||
}
|
||||
|
||||
if (exists $i_ignore->{$entry}) {
|
||||
debug sprintf ' [%s] interfaces - ignoring %s (%s) (%s)',
|
||||
debug sprintf ' [%s] interfaces - ignoring %s (%s) (%s) (SNMP::Info::i_ignore)',
|
||||
$device->ip, $entry, $port, ($i_type->{$entry} || '');
|
||||
next;
|
||||
}
|
||||
|
||||
# Skip interfaces by type filter
|
||||
if (defined $i_type->{$entry} and (scalar grep {$i_type->{$entry} =~ m/^$_$/} @{setting('ignore_interface_types') || []})) {
|
||||
debug sprintf ' [%s] interfaces - ignoring %s (%s) (%s) (config:ignore_interface_types)',
|
||||
$device->ip, $entry, $port, $i_type->{$entry};
|
||||
next;
|
||||
}
|
||||
|
||||
# Skip interfaces which are 'notPresent' and match the notpresent type filter
|
||||
if (defined $i_up->{$entry} and defined $i_type->{$entry} and $i_up->{$entry} eq 'notPresent' and (scalar grep {$i_type->{$entry} =~ m/^$_$/} @{setting('ignore_notpresent_types') || []}) ) {
|
||||
debug sprintf ' [%s] interfaces - ignoring %s (%s) (%s) (config:ignore_notpresent_types)',
|
||||
|
||||
@@ -311,6 +311,7 @@ ignore_interfaces:
|
||||
- 'Ethernet(?:-| )QOS Packet Scheduler'
|
||||
- 'Ethernet(?:-| )WFP (?:802\.3|Native) MAC Layer Lightweight Filter'
|
||||
- 'ii\d\/\d\/\d+'
|
||||
ignore_interface_types: []
|
||||
ignore_notpresent_types:
|
||||
- 'ethernetCsmacd'
|
||||
- 'tunnel'
|
||||
|
||||
Reference in New Issue
Block a user