Trim whitespaces from device data (#14429)

* Trim whitespace from sensor and ports data

* Update arista_eos_vrf.json

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update Os.php

* wip

* wip

* wip

* Update querybuilder.json
This commit is contained in:
Jellyfrog
2022-10-11 19:50:38 +02:00
committed by GitHub
parent 8ddb612919
commit 7207614437
113 changed files with 1340 additions and 1325 deletions

View File

@@ -920,10 +920,10 @@ function discovery_process(&$valid, $os, $sensor_class, $pre_cache)
$oid = str_replace('{{ $index_string }}', strlen($index) . '.' . implode('.', unpack('c*', $index)), $oid);
// process the description
$descr = YamlDiscovery::replaceValues('descr', $index, null, $data, $pre_cache);
$descr = trim(YamlDiscovery::replaceValues('descr', $index, null, $data, $pre_cache));
// process the group
$group = YamlDiscovery::replaceValues('group', $index, null, $data, $pre_cache) ?: null;
$group = trim(YamlDiscovery::replaceValues('group', $index, null, $data, $pre_cache)) ?: null;
$divisor = $data['divisor'] ?? ($sensor_options['divisor'] ?? 1);
$multiplier = $data['multiplier'] ?? ($sensor_options['multiplier'] ?? 1);