From 549741d31ed3986973e4aaa0c183d1676c3aaf4f Mon Sep 17 00:00:00 2001 From: Nicolas Berens Date: Sat, 3 Aug 2024 19:31:07 +0200 Subject: [PATCH] fix splitting of perfdata (#16255) --- includes/services.inc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/services.inc.php b/includes/services.inc.php index b282b0d744..22a4b94cb4 100644 --- a/includes/services.inc.php +++ b/includes/services.inc.php @@ -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 = [];