Fixes - default module

This commit is contained in:
fbsanchez 2020-04-08 13:01:11 +02:00
parent 748582509a
commit bb11403c4b
2 changed files with 13 additions and 1 deletions

View File

@ -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;

View File

@ -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;