mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Allow getCacheByIndex snmpflags (#9777)
* allow snmpflags getCacheByIndex * Allow snmpflags to getCacheByIndex
This commit is contained in:
@ -106,9 +106,10 @@ class OS implements ProcessorDiscovery
|
||||
*
|
||||
* @param string $oid textual oid
|
||||
* @param string $mib mib for this oid
|
||||
* @param string $snmpflags snmpflags for this oid
|
||||
* @return array array indexed by the snmp index with the value as the data returned by snmp
|
||||
*/
|
||||
public function getCacheByIndex($oid, $mib = null)
|
||||
public function getCacheByIndex($oid, $mib = null, $snmpflags = '-OQUs')
|
||||
{
|
||||
if (str_contains($oid, '.')) {
|
||||
echo "Error: don't use this with numeric oids!\n";
|
||||
@ -116,7 +117,7 @@ class OS implements ProcessorDiscovery
|
||||
}
|
||||
|
||||
if (!isset($this->cache[$oid])) {
|
||||
$data = snmpwalk_cache_oid($this->getDevice(), $oid, array(), $mib);
|
||||
$data = snmpwalk_cache_oid($this->getDevice(), $oid, array(), $mib, null, $snmpflags);
|
||||
$this->cache[$oid] = array_map('current', $data);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user