From e3f6dbe704e22e8f8a23fd1b551a811a7c7c0d0d Mon Sep 17 00:00:00 2001 From: tkas Date: Tue, 5 Sep 2023 19:53:02 +0200 Subject: [PATCH] make number diskstats entries not fixed - kernel 6.x --- sources/disk.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/disk.php b/sources/disk.php index 86d6cf0..7d0d8e7 100644 --- a/sources/disk.php +++ b/sources/disk.php @@ -105,7 +105,7 @@ private function getStats() $this->stats_part = array(); foreach ($lines as $line) { - if (preg_match('/^\s*[0-9]+\s+[0-9]+\s+' . preg_quote($this->disk, '/') . '\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s*$/i', $line, $parts)) + if (preg_match('/^\s*[0-9]+\s+[0-9]+\s+' . preg_quote($this->disk, '/') . '\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s*/i', $line, $parts)) { $this->stats_disk = array( /* @@ -122,7 +122,7 @@ private function getStats() 'ms_io_weighted' => $parts[11]*/ ); } - elseif ($this->withpartitions && preg_match('/^\s*[0-9]+\s+[0-9]+\s+' . preg_quote($this->disk, '/') . '([0-9]*)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s*$/i', $line, $parts)) + elseif ($this->withpartitions && preg_match('/^\s*[0-9]+\s+[0-9]+\s+' . preg_quote($this->disk, '/') . '([0-9]*)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s*/i', $line, $parts)) { $this->stats_part[$parts[1]] = array( /*