Array to String conversion fix (#10976)

* array to string conversion fix

* .

* Update cdata.yaml

Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
This commit is contained in:
SourceDoctor
2019-12-26 23:49:01 +01:00
committed by PipoCanaja
parent 2953358992
commit 07ef8e2f67
2 changed files with 9 additions and 5 deletions

View File

@@ -227,9 +227,10 @@ class Device extends BaseModel
} else {
// load from yaml
if ($existing) {
$os_list = array_map(function ($os) use ($install_dir) {
return $install_dir . '/includes/definitions/' . $os . '.yaml';
}, self::distinct('os')->get('os')->toArray());
$os_list = [];
foreach (self::distinct('os')->get('os')->toArray() as $os) {
$os_list[] = $install_dir . '/includes/definitions/' . $os['os'] . '.yaml';
}
} else {
$os_list = glob($install_dir . '/includes/definitions/*.yaml');
}

View File

@@ -10,5 +10,8 @@ over:
- { graph: device_processor, text: 'CPU Usage' }
- { graph: device_mempool, text: 'Memory Usage' }
discovery:
- sysObjectID:
- .1.3.6.1.4.1.17409
-
sysObjectID:
- .1.3.6.1.4.1.17409
sysObjectID_except:
- .1.3.6.1.4.1.17409.1