mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
devices - Ciena RLS 6500 (#15909)
* rls definition * Adding discovery * Temp Sensor Discovery * files for discovery * Adding and updating MIBS * Add snmpsim * Modified yaml for unit test * phpfmt format * ci changes * fixing temp sensor * fix json * db schema out of date causing bad snmpsim json * changed temperature discovery to php * With updated snmpsim data * index_string restored, YAML for temperature * style * Fixed index_string usage in JUNOS files * Update YamlDiscovery.php Allow filtering on "index" in skip_values * Move DBM to YAML as well * style * schema update * Slot XX Yyyyyy remove unwanted dot * matching tests * schema, round 2 * states in YAML * put temp sensor back in yaml * enable default poll and discovery modules --------- Co-authored-by: PipoCanaja <38363551+PipoCanaja@users.noreply.github.com>
This commit is contained in:
@@ -188,6 +188,11 @@ class YamlDiscovery
|
||||
$variables = [
|
||||
'index' => $index,
|
||||
'count' => $count,
|
||||
// we compute a numOid compatible version of index
|
||||
// string length followed by ASCII of each char.
|
||||
'index_string' => implode('.', array_map(function ($index) {
|
||||
return strlen($index) . '.' . implode('.', unpack('c*', $index));
|
||||
}, explode('.', $index))),
|
||||
];
|
||||
foreach (explode('.', $index) as $pos => $subindex) {
|
||||
$variables['subindex' . $pos] = $subindex;
|
||||
@@ -378,6 +383,8 @@ class YamlDiscovery
|
||||
if (isset($skip_value['device'])) {
|
||||
// field from device model
|
||||
$tmp_value = \DeviceCache::getPrimary()[$skip_value['device']] ?? null;
|
||||
} elseif ($skip_value['oid'] == 'index') {
|
||||
$tmp_value = $index;
|
||||
} else {
|
||||
// oid previously fetched from the device
|
||||
$tmp_value = static::getValueFromData($skip_value['oid'], $index, $yaml_item_data, $pre_cache);
|
||||
|
Reference in New Issue
Block a user