From 02c4fe30a3574b983851238bd91ba02524089686 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Fri, 9 Oct 2020 14:50:37 +0200 Subject: [PATCH] OID naming compatibility when starts with "." or not --- pandora_server/lib/PandoraFMS/Recon/Base.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Recon/Base.pm b/pandora_server/lib/PandoraFMS/Recon/Base.pm index 1f6e13f2e6..e14b200fa3 100644 --- a/pandora_server/lib/PandoraFMS/Recon/Base.pm +++ b/pandora_server/lib/PandoraFMS/Recon/Base.pm @@ -2144,7 +2144,7 @@ sub snmp_get_value($$$) { foreach my $line (@output) { $line =~ s/[\r\n]//g; - return $1 if ($line =~ /^$effective_oid\s+=\s+\S+:\s+(.*)/); + return $1 if ($line =~ /^\.{0,1}$effective_oid\s+=\s+\S+:\s+(.*)/); } return undef; @@ -2160,7 +2160,7 @@ sub snmp_get_value_array($$$) { my @output = $self->snmp_get($device, $oid); foreach my $line (@output) { chomp($line); - push(@values, $1) if ($line =~ /^$oid\S*\s+=\s+\S+:\s+(.*)$/); + push(@values, $1) if ($line =~ /^\.{0,1}$oid\S*\s+=\s+\S+:\s+(.*)$/); } return @values;