OID naming compatibility when starts with "." or not
This commit is contained in:
parent
3c932e1e71
commit
02c4fe30a3
|
@ -2144,7 +2144,7 @@ sub snmp_get_value($$$) {
|
||||||
|
|
||||||
foreach my $line (@output) {
|
foreach my $line (@output) {
|
||||||
$line =~ s/[\r\n]//g;
|
$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;
|
return undef;
|
||||||
|
@ -2160,7 +2160,7 @@ sub snmp_get_value_array($$$) {
|
||||||
my @output = $self->snmp_get($device, $oid);
|
my @output = $self->snmp_get($device, $oid);
|
||||||
foreach my $line (@output) {
|
foreach my $line (@output) {
|
||||||
chomp($line);
|
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;
|
return @values;
|
||||||
|
|
Loading…
Reference in New Issue