fix problem with snmp_get_multi

git-svn-id: http://www.observium.org/svn/observer/trunk@3163 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2012-05-10 15:02:57 +00:00
parent e490d32489
commit fe67f1e5a2
2 changed files with 9 additions and 2 deletions
+7 -1
View File
@@ -53,7 +53,13 @@ function snmp_get_multi($device, $oids, $options = "-OQUs", $mib = NULL, $mibdir
$runtime_stats['snmpget']++;
foreach (explode("\n", $data) as $entry)
{
$array[$index][$oid] = $value;
list($oid,$value) = explode("=", $entry);
$oid = trim($oid); $value = trim($value);
list($oid, $index) = explode(".", $oid);
if (!strstr($value, "at this OID") && isset($oid) && isset($index))
{
$array[$index][$oid] = $value;
}
}
return $array;