mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
added oids.no_bulk os setting (#13666)
* forcewalk param * [snmp][no_bulk] * var names, test, schema * Key off OIDs, not mibs luminato is POC and needs to be reverted before merge. * fix up os schema * docs * remove luminato arbitrary changes Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
@@ -269,7 +269,7 @@ class NetSnmpQuery implements SnmpQueryInterface
|
||||
|
||||
private function buildCli(string $command, array $oids): array
|
||||
{
|
||||
$cmd = $this->initCommand($command);
|
||||
$cmd = $this->initCommand($command, $oids);
|
||||
|
||||
array_push($cmd, '-M', $this->mibDirectories());
|
||||
|
||||
@@ -349,9 +349,13 @@ class NetSnmpQuery implements SnmpQueryInterface
|
||||
return new SnmpResponse($output, $stderr, $exitCode);
|
||||
}
|
||||
|
||||
private function initCommand(string $binary): array
|
||||
private function initCommand(string $binary, array $oids): array
|
||||
{
|
||||
if ($binary == 'snmpwalk' && $this->device->snmpver !== 'v1' && Config::getOsSetting($this->device->os, 'snmp_bulk', true)) {
|
||||
if ($binary == 'snmpwalk'
|
||||
&& $this->device->snmpver !== 'v1'
|
||||
&& Config::getOsSetting($this->device->os, 'snmp_bulk', true)
|
||||
&& empty(array_intersect($oids, Config::getCombined($this->device->os, 'oids.no_bulk'))) // skip for oids that do not work with bulk
|
||||
) {
|
||||
$snmpcmd = [Config::get('snmpbulkwalk', 'snmpbulkwalk')];
|
||||
|
||||
$max_repeaters = $this->device->getAttrib('snmp_max_repeaters') ?: Config::getOsSetting($this->device->os, 'snmp.max_repeaters', Config::get('snmp.max_repeaters', false));
|
||||
|
Reference in New Issue
Block a user