#475 fix discover plugins do not respect ignore* config

This commit is contained in:
Oliver Gorwits
2019-01-02 22:36:59 +00:00
parent de27866077
commit ccb0f0c78a
7 changed files with 80 additions and 8 deletions

View File

@@ -33,6 +33,10 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub {
};
}
# cache the device ports to save hitting the database for many single rows
my $device_ports = vars->{'device_ports'}
|| { map {($_->port => $_)} $device->ports->all };
my $i_vlan = $snmp->i_vlan;
my $i_vlan_membership = $snmp->i_vlan_membership;
my $i_vlan_type = $snmp->i_vlan_type;
@@ -42,8 +46,13 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub {
my @portvlans = ();
foreach my $entry (keys %$i_vlan_membership) {
my %port_vseen = ();
my $port = $interfaces->{$entry};
next unless defined $port;
my $port = $interfaces->{$entry} or next;
if (!defined $device_ports->{$port}) {
info sprintf ' [%s] vlans - local port %s not in database!',
$device->ip, $port;
next;
}
my $type = $i_vlan_type->{$entry};