#1127 uninitialized value in Worker/Plugin/Discover/Entities.pm line 109

This commit is contained in:
Oliver Gorwits
2023-11-21 15:49:43 +00:00
parent 6830c39105
commit 5653cb8bbe

View File

@@ -100,13 +100,13 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub {
} }
foreach my $m (@modules){ foreach my $m (@modules){
unless (!$m->{parent} || $seen_idx{$m->{parent}}){ if ($m->{parent} and not exists $seen_idx{ $m->{parent} }){
# Some combined devices like Nexus with FEX or ASR with Satellites can return invalid # Some combined devices like Nexus with FEX or ASR with Satellites can return invalid
# EntityMIB trees. This workaround relocates entitites with invalid parents to the root # EntityMIB trees. This workaround relocates entitites with invalid parents to the root
# of the tree, so they are at least visible in the Modules tab (see #710) # of the tree, so they are at least visible in the Modules tab (see #710)
info sprintf ' [%s] Entity %s (%s) has invalid parent %s - attaching as root entity instead', info sprintf ' [%s] Entity %s (%s) has invalid parent %s - attaching as root entity instead',
$device->ip, $m->{index}, $m->{name}, $m->{parent}; $device->ip, ($m->{index} || '"unknown index"'), ($m->{name} || '"unknown name"'), $m->{parent};
$m->{parent} = undef; $m->{parent} = undef;
} }
} }