Allow getCacheByIndex snmpflags (#9777)

* allow snmpflags getCacheByIndex

* Allow snmpflags to getCacheByIndex
This commit is contained in:
djamp42
2019-02-07 07:42:23 -05:00
committed by Tony Murray
parent 1f53e7658c
commit 9eaca7f9d6

View File

@ -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);
}