mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 01:05:39 +02:00
updates
This commit is contained in:
parent
2bfee57a67
commit
dfa31d5227
@ -2109,16 +2109,16 @@ sub snmp_get_value($$$) {
|
|||||||
my ($self, $device, $oid) = @_;
|
my ($self, $device, $oid) = @_;
|
||||||
|
|
||||||
my $effective_oid = $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`;
|
$effective_oid = `snmptranslate $oid -On 2>$DEVNULL`;
|
||||||
chomp($effective_oid);
|
$effective_oid =~ s/[\r\n]//g;
|
||||||
}
|
}
|
||||||
|
|
||||||
my @output = $self->snmp_get($device, $effective_oid);
|
my @output = $self->snmp_get($device, $effective_oid);
|
||||||
|
|
||||||
foreach my $line (@output) {
|
foreach my $line (@output) {
|
||||||
chomp($line);
|
$line =~ s/[\r\n]//g;
|
||||||
return $1 if ($line =~ /^$effective_oid\s+=\s+\S+:\s+(.*)$/);
|
return $1 if ($line =~ /^$effective_oid\s+=\s+\S+:\s+(.*)/);
|
||||||
}
|
}
|
||||||
|
|
||||||
return undef;
|
return undef;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user