From dfa31d5227746e79de02e086fb0a8bd1787f7a9b Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 28 Apr 2020 13:26:57 +0200 Subject: [PATCH] updates --- pandora_server/lib/PandoraFMS/Recon/Base.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Recon/Base.pm b/pandora_server/lib/PandoraFMS/Recon/Base.pm index 4b3a920f9f..bbe7802097 100644 --- a/pandora_server/lib/PandoraFMS/Recon/Base.pm +++ b/pandora_server/lib/PandoraFMS/Recon/Base.pm @@ -2109,16 +2109,16 @@ sub snmp_get_value($$$) { my ($self, $device, $oid) = @_; my $effective_oid = $oid; - if (is_enabled($self->{'translate_snmp'})) { + if (is_enabled($self->{'translate_snmp'}) && $oid !~ /^[\.\d]+$/) { $effective_oid = `snmptranslate $oid -On 2>$DEVNULL`; - chomp($effective_oid); + $effective_oid =~ s/[\r\n]//g; } my @output = $self->snmp_get($device, $effective_oid); - + foreach my $line (@output) { - chomp($line); - return $1 if ($line =~ /^$effective_oid\s+=\s+\S+:\s+(.*)$/); + $line =~ s/[\r\n]//g; + return $1 if ($line =~ /^$effective_oid\s+=\s+\S+:\s+(.*)/); } return undef;