Execute command during scanning and not during the creation of Agent

This commit is contained in:
felix.suarez 2023-12-21 21:29:19 -06:00
parent 82bc2c3f98
commit 6dea725452
1 changed files with 7 additions and 4 deletions

View File

@ -1662,9 +1662,6 @@ sub PandoraFMS::Recon::Base::report_scanned_agents($;$) {
$os_id = $self->guess_os($data->{'agent'}{'direccion'});
}
if (is_empty($data->{'agent'}{'os_version'})) {
$data->{'agent'}{'os_version'} = $self->guess_os($data->{'agent'}{'direccion'}, undef, 1);
}
$self->call('message', "Agent accepted: ".$data->{'agent'}{'nombre'}, 5);
@ -2022,8 +2019,14 @@ sub PandoraFMS::Recon::Base::report_scanned_agents($;$) {
# Retrieve target agent OS.
$self->{'agents_found'}->{$addr}{'agent'}{'id_os'} = $self->guess_os($addr);
my $os_version = $self->get_os_version($addr);
if (is_empty($os_version)) {
$os_version = $self->guess_os($addr, undef, 1);
}
# Retrieve target agent OS version.
$self->{'agents_found'}->{$addr}{'agent'}{'os_version'} = $self->get_os_version($addr);
$self->{'agents_found'}->{$addr}{'agent'}{'os_version'} = $os_version;
$self->call('update_progress', $progress);
$progress += $step;