Update handling of value assignment when 'jsonelem' is not set.

- Adjusted code to assign $output directly to 'value' if 'jsonelem' is not set.
This commit is contained in:
Jeroen De Meerleer 2024-06-03 19:48:39 +02:00
parent 7aef1769d9
commit d0fa8a6a99
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6

View File

@ -16,6 +16,8 @@ if($_SERVER["REQUEST_URI"] == '/metrics') {
} }
if(isset($c['jsonelem'])) { if(isset($c['jsonelem'])) {
$c['value'] = getArrayValue($c['jsonelem'], json_decode($output, true)); $c['value'] = getArrayValue($c['jsonelem'], json_decode($output, true));
} else {
$c['value'] = $output;
} }
} }