This commit is contained in:
fbsanchez 2020-04-30 16:25:00 +02:00
parent 900e25eef1
commit da92cb53f8
2 changed files with 13 additions and 3 deletions

View File

@ -935,6 +935,16 @@ sub PandoraFMS::Recon::Base::create_network_profile_modules($$) {
$np_component->{'id_nc'} $np_component->{'id_nc'}
); );
# Tag cleanup.
if (!is_empty($component->{'tags'})) {
my @tags = map {
if ($_ > 0) { $_ }
else {}
} split ',', $component->{'tags'};
$component->{'tags'} = join ',', @tags;
}
$component->{'name'} = safe_output($component->{'name'}); $component->{'name'} = safe_output($component->{'name'});
if ($component->{'type'} >= 15 && $component->{'type'} <= 18) { if ($component->{'type'} >= 15 && $component->{'type'} <= 18) {
$component->{'snmp_community'} = safe_output($self->get_community($device)); $component->{'snmp_community'} = safe_output($self->get_community($device));
@ -1386,6 +1396,7 @@ sub PandoraFMS::Recon::Base::report_scanned_agents($;$) {
$progress += $step; $progress += $step;
# Store temporally. Wait user approval. # Store temporally. Wait user approval.
my $encoded; my $encoded;
eval { eval {
local $SIG{__DIE__}; local $SIG{__DIE__};
$encoded = encode_base64( $encoded = encode_base64(

View File

@ -1364,7 +1364,7 @@ sub prepare_agent($$) {
$self->{'agents_found'} = {} if ref($self->{'agents_found'}) ne 'HASH'; $self->{'agents_found'} = {} if ref($self->{'agents_found'}) ne 'HASH';
# Already initialized. # Already initialized.
return if ref($self->{'agents_found'}->{$host_name}) eq 'HASH'; return if (ref($self->{'agents_found'}->{$addr}) eq 'HASH');
my @addresses = $self->get_addresses($addr); my @addresses = $self->get_addresses($addr);
$self->{'agents_found'}->{$addr} = { $self->{'agents_found'}->{$addr} = {
@ -1413,8 +1413,7 @@ sub add_module($$$) {
return unless is_enabled($rs); return unless is_enabled($rs);
$self->{'agents_found'}->{$agent}->{'modules'}{$data->{'name'}} = $data; $self->{'agents_found'}->{$agent}->{'modules'}->{$data->{'name'}} = $data;
} }
################################################################################ ################################################################################