Add feature to capture a full snmprec (#12706)

This commit is contained in:
Jellyfrog
2021-04-07 00:26:31 +02:00
committed by GitHub
parent 4b9e480118
commit a70d55bfd8
3 changed files with 22 additions and 7 deletions

View File

@@ -140,9 +140,18 @@ class ModuleTestHelper
$this->json_file = $path;
}
public function captureFromDevice($device_id, $write = true, $prefer_new = false)
public function captureFromDevice($device_id, $write = true, $prefer_new = false, $full = false)
{
$snmp_oids = $this->collectOids($device_id);
if ($full) {
$snmp_oids[] = [
'oid' => '.',
'method' => 'walk',
'mib' => null,
'mibdir' => null,
];
} else {
$snmp_oids = $this->collectOids($device_id);
}
$device = device_by_id_cache($device_id, true);
DeviceCache::setPrimary($device_id);