mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix: snmp_get_multi returns no data if the oid doesn't contain a period (#7456)
This commit is contained in:
committed by
Neil Lathwood
parent
3d41019b61
commit
46ee1b377c
@@ -202,8 +202,16 @@ function snmp_get_multi($device, $oids, $options = '-OQUs', $mib = null, $mibdir
|
|||||||
$oid = trim($oid);
|
$oid = trim($oid);
|
||||||
$value = trim($value, "\" \n\r");
|
$value = trim($value, "\" \n\r");
|
||||||
list($oid, $index) = explode('.', $oid, 2);
|
list($oid, $index) = explode('.', $oid, 2);
|
||||||
if (!strstr($value, 'at this OID') && isset($oid) && isset($index)) {
|
|
||||||
$array[$index][$oid] = $value;
|
if (!str_contains($value, 'at this OID')) {
|
||||||
|
if (is_null($index)) {
|
||||||
|
if (empty($oid)) {
|
||||||
|
continue; // no index or oid
|
||||||
|
}
|
||||||
|
$array[$oid] = $value;
|
||||||
|
} else {
|
||||||
|
$array[$index][$oid] = $value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user