diff --git a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm index 4944e03ab5..3d36bcfbaa 100644 --- a/pandora_server/lib/PandoraFMS/DiscoveryServer.pm +++ b/pandora_server/lib/PandoraFMS/DiscoveryServer.pm @@ -469,7 +469,13 @@ sub PandoraFMS::Recon::Base::test_module($$) { $test->{'id_tipo_modulo'} = $module->{'type'}; } else { # Module. - $test->{'id_tipo_modulo'} = $module->{'id_modulo'}; + if (!defined($self->{'module_types'}{$module->{'type'}})) { + $self->{'module_types'}{$module->{'type'}} = get_module_id( + $self->{'dbh'},$module->{'type'} + ); + } + + $test->{'id_tipo_modulo'} = $self->{'module_types'}{$module->{'type'}}; } my $value; diff --git a/pandora_server/lib/PandoraFMS/Recon/Base.pm b/pandora_server/lib/PandoraFMS/Recon/Base.pm index 21418c32e0..20a31da76b 100644 --- a/pandora_server/lib/PandoraFMS/Recon/Base.pm +++ b/pandora_server/lib/PandoraFMS/Recon/Base.pm @@ -1475,6 +1475,12 @@ sub scan_subnet($) { $self->call('update_progress', ceil($progress)); $total_hosts = scalar keys %hosts_alive; + if ($total_hosts == 0) { + # Populate. + $self->{'c_network_percent'} += 50; + $self->call('update_progress', ceil($progress)+25); + next; + } $step = 25.0 / scalar(@subnets) / $total_hosts; $subnet_step = 50.0 / $total_hosts;