mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix Undefined variable/key warnings (#14134)
* Fix Undefined variable/key warnings * massage for test data * restore set_numeric, only generates noise * Fix ucd storage used (apparently free is not stored in discovery...)
This commit is contained in:
@@ -226,7 +226,9 @@ class YamlDiscovery
|
||||
$sub_index = 0;
|
||||
$sub_index_end = null;
|
||||
if (preg_match('/^(.+):(\d+)(?:-(\d+))?$/', $name, $matches)) {
|
||||
[,$name, $sub_index, $sub_index_end] = $matches;
|
||||
$name = $matches[1] ?? null;
|
||||
$sub_index = $matches[2] ?? null;
|
||||
$sub_index_end = $matches[3] ?? null;
|
||||
}
|
||||
|
||||
if (isset($pre_cache[$name]) && ! is_numeric($name)) {
|
||||
@@ -291,7 +293,7 @@ class YamlDiscovery
|
||||
$saved_nobulk = Config::getOsSetting($os->getName(), 'snmp_bulk', true);
|
||||
|
||||
foreach ($data_array as $data) {
|
||||
foreach ((array) $data['oid'] as $oid) {
|
||||
foreach (Arr::wrap($data['oid'] ?? []) as $oid) {
|
||||
if (! array_key_exists($oid, $pre_cache)) {
|
||||
if (isset($data['snmp_flags'])) {
|
||||
$snmp_flag = Arr::wrap($data['snmp_flags']);
|
||||
|
Reference in New Issue
Block a user