Add 'nobulk' setting in sensors yaml (#12833)

* nobulk setting in sensors yaml
* silly python
This commit is contained in:
Tony Murray
2021-05-30 00:08:20 +02:00
committed by GitHub
parent 15da7faef1
commit 143765ced8
2 changed files with 13 additions and 0 deletions
+10
View File
@@ -27,6 +27,7 @@ namespace LibreNMS\Device;
use Cache;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use LibreNMS\Config;
use LibreNMS\Exceptions\InvalidOidException;
use LibreNMS\Interfaces\Discovery\DiscoveryItem;
use LibreNMS\OS;
@@ -288,6 +289,8 @@ class YamlDiscovery
continue;
}
$saved_nobulk = Config::getOsSetting($os->getName(), 'nobulk', false);
foreach ($data_array as $data) {
foreach ((array) $data['oid'] as $oid) {
if (! array_key_exists($oid, $pre_cache)) {
@@ -300,8 +303,15 @@ class YamlDiscovery
}
$snmp_flag[] = '-Ih';
// disable bulk request for specific data
if (! empty($data['nobulk'])) {
Config::set('os.' . $os->getName() . '.nobulk', true);
}
$mib = $device['dynamic_discovery']['mib'];
$pre_cache[$oid] = snmpwalk_cache_oid($device, $oid, $pre_cache[$oid] ?? [], $mib, null, $snmp_flag);
Config::set('os.' . $os->getName() . '.nobulk', $saved_nobulk);
}
}
}
+3
View File
@@ -433,6 +433,9 @@
"array"
]
},
"nobulk": {
"type": "boolean"
},
"entPhysicalIndex": {
"type": ["integer", "string"]
},