#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

@@ -18,6 +18,10 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub {
my $ssidlist = $snmp->i_ssidlist;
return unless scalar keys %$ssidlist;
# 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 $interfaces = $snmp->interfaces;
my $ssidbcast = $snmp->i_ssidbcast;
my $ssidmac = $snmp->i_ssidmac;
@@ -36,6 +40,12 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub {
next;
}
if (!defined $device_ports->{$port}) {
info sprintf ' [%s] wireless - local port %s not in database!',
$device->ip, $port;
next;
}
push @ssids, {
port => $port,
ssid => $ssidlist->{$entry},
@@ -64,6 +74,12 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub {
next;
}
if (!defined $device_ports->{$port}) {
info sprintf ' [%s] wireless - local port %s not in database!',
$device->ip, $port;
next;
}
push @channels, {
port => $port,
channel => $channel->{$entry},