04-05-2020, 07:09 AM
Hi there
Is there anyone experiencing this issue? When running a discovery task (Discovery.NetScan) It ends up in a second with no new agents detected showing 100% completed.
On pandora_server.log there's an error with DiscoveryServer.pm:
2020-04-05 06:56:31 Base: ******** [V1] [E] '********': hash- or arrayref expected (not a simple scalar, use allow_nonref to allow this) at /usr/lib/perl5/PandoraFMS/DiscoveryServer.pm line 1026.
2020-04-05 06:56:31 Base: ******** [V1] Pandora FMS Server ' ********' unhandled error.
Seems that the issue has something to do with this block of code in particular with the encode_json($stats)
##########################################################################
# Update recon task status.
##########################################################################
sub PandoraFMS::Recon::Base::update_progress ($$) {
my ($self, $progress) = @_;
my $stats = {};
if (defined($self->{'summary'}) && $self->{'summary'} ne '') {
$stats->{'summary'} = $self->{'summary'};
}
$stats->{'step'} = $self->{'step'};
$stats->{'c_network_name'} = $self->{'c_network_name'};
$stats->{'c_network_percent'} = $self->{'c_network_percent'};
# Store progress, last contact and overall status.
db_do ($self->{'dbh'}, 'UPDATE trecon_task SET utimestamp = ?, status = ?, summary = ? WHERE id_rt = ?',
time (), $progress, encode_json($stats), $self->{'task_id'});
}
Any idea on how to fix the code or why is this happening? Perl version is 5.26.1-6ubuntu0.3
BR
EH
Is there anyone experiencing this issue? When running a discovery task (Discovery.NetScan) It ends up in a second with no new agents detected showing 100% completed.
On pandora_server.log there's an error with DiscoveryServer.pm:
2020-04-05 06:56:31 Base: ******** [V1] [E] '********': hash- or arrayref expected (not a simple scalar, use allow_nonref to allow this) at /usr/lib/perl5/PandoraFMS/DiscoveryServer.pm line 1026.
2020-04-05 06:56:31 Base: ******** [V1] Pandora FMS Server ' ********' unhandled error.
Seems that the issue has something to do with this block of code in particular with the encode_json($stats)
##########################################################################
# Update recon task status.
##########################################################################
sub PandoraFMS::Recon::Base::update_progress ($$) {
my ($self, $progress) = @_;
my $stats = {};
if (defined($self->{'summary'}) && $self->{'summary'} ne '') {
$stats->{'summary'} = $self->{'summary'};
}
$stats->{'step'} = $self->{'step'};
$stats->{'c_network_name'} = $self->{'c_network_name'};
$stats->{'c_network_percent'} = $self->{'c_network_percent'};
# Store progress, last contact and overall status.
db_do ($self->{'dbh'}, 'UPDATE trecon_task SET utimestamp = ?, status = ?, summary = ? WHERE id_rt = ?',
time (), $progress, encode_json($stats), $self->{'task_id'});
}
Any idea on how to fix the code or why is this happening? Perl version is 5.26.1-6ubuntu0.3
BR
EH