#729 Discovery partially fails on invalid indexes
This commit is contained in:
6
Changes
6
Changes
@@ -1,3 +1,9 @@
|
|||||||
|
2.046000 - 2020-06-29
|
||||||
|
|
||||||
|
[BUG FIXES]
|
||||||
|
|
||||||
|
* #729 Discovery partially fails on invalid indexes
|
||||||
|
|
||||||
2.045007 - 2020-06-05
|
2.045007 - 2020-06-05
|
||||||
|
|
||||||
[BUG FIXES]
|
[BUG FIXES]
|
||||||
|
|||||||
@@ -72,7 +72,15 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub {
|
|||||||
# build device modules list for DBIC
|
# build device modules list for DBIC
|
||||||
my (@modules, %seen_idx);
|
my (@modules, %seen_idx);
|
||||||
foreach my $entry (keys %$e_index) {
|
foreach my $entry (keys %$e_index) {
|
||||||
|
next unless defined $e_index->{$entry};
|
||||||
next if $seen_idx{ $e_index->{$entry} }++;
|
next if $seen_idx{ $e_index->{$entry} }++;
|
||||||
|
|
||||||
|
if ($e_index->{$entry} !~ m/^[0-9]+$/) {
|
||||||
|
debug sprintf ' [%s] modules - index %s is not an integer',
|
||||||
|
$device->ip, $e_index->{$entry};
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
push @modules, {
|
push @modules, {
|
||||||
index => $e_index->{$entry},
|
index => $e_index->{$entry},
|
||||||
type => $e_type->{$entry},
|
type => $e_type->{$entry},
|
||||||
|
|||||||
@@ -102,13 +102,21 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub {
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach my $idx (keys %$interfaces) {
|
foreach my $idx (keys %$interfaces) {
|
||||||
|
next unless defined $idx;
|
||||||
my $port = $interfaces->{$idx} or next;
|
my $port = $interfaces->{$idx} or next;
|
||||||
|
|
||||||
if (!defined $device_ports->{$port}) {
|
if (!defined $device_ports->{$port}) {
|
||||||
debug sprintf ' [%s] properties/ifindex - local port %s already skipped, ignoring',
|
debug sprintf ' [%s] properties/ifindex - local port %s already skipped, ignoring',
|
||||||
$device->ip, $port;
|
$device->ip, $port;
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($idx !~ m/^[0-9]+$/) {
|
||||||
|
debug sprintf ' [%s] properties/ifindex - port %s ifindex %s is not an integer',
|
||||||
|
$device->ip, $port, $idx;
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
$properties{ $port }->{ifindex} = $idx;
|
$properties{ $port }->{ifindex} = $idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user