minor fix

This commit is contained in:
fbsanchez 2020-04-13 15:30:13 +02:00
parent 7395410831
commit 189d85d659
1 changed files with 4 additions and 4 deletions

View File

@ -1221,7 +1221,7 @@ sub PandoraFMS::Recon::Base::report_scanned_agents($;$) {
# Update parent relationships.
foreach my $agent (@agents) {
# Avoid processing if does not exist.
next unless (defined($agent->{'agent'}{'agent_id'}));
next unless (defined($agent->{'agent_id'}));
# Avoid processing undefined parents.
next unless defined($agent->{'parent'});
@ -1234,12 +1234,12 @@ sub PandoraFMS::Recon::Base::report_scanned_agents($;$) {
next unless defined($parent);
# Is the agent in learning mode?
next unless ($agent->{'agent'}{'modo'} == 1);
next unless ($agent->{'modo'} == 1);
# Connect the host to its parent.
db_do($self->{'dbh'},
'UPDATE tagente SET id_parent=? WHERE id_agente=?',
$parent->{'id_agente'}, $agent->{'agent'}{'agent_id'}
$parent->{'id_agente'}, $agent->{'agent_id'}
);
}
@ -1612,7 +1612,7 @@ sub PandoraFMS::Recon::Base::set_parent($$$) {
# Do not edit 'not scaned' agents.
return if is_empty($self->{'agents_found'}{$host}{'agent'});
$self->{'agents_found'}{$host}{'parent'} = $parent;
$self->{'agents_found'}{$host}{'agent'}{'parent'} = $parent;
}