fix splitting of perfdata (#16255)

This commit is contained in:
Nicolas Berens
2024-08-03 19:31:07 +02:00
committed by GitHub
parent 447f06599e
commit 549741d31e

View File

@@ -247,8 +247,10 @@ function check_service($command)
// Split out the response and the performance data.
[$response, $perf] = explode('|', $response_string);
// Split each performance metric
$perf_arr = explode(' ', $perf);
// Split performance metrics into an array
preg_match_all('/\'[^\']*\'\S*|\S+/', $perf, $perf_arr);
// preg_match_all returns a 2D array, we only need the first one
$perf_arr = $perf_arr[0];
// Create an array for our metrics.
$metrics = [];