diff options
author | Simon Rettberg | 2019-12-13 15:19:55 +0100 |
---|---|---|
committer | Simon Rettberg | 2019-12-13 15:19:55 +0100 |
commit | ab9fbf17cc71d56a01ff82d26af13872b41e5112 (patch) | |
tree | ba373b0a69f6b705e3587d4b11fb663a57b9d0db /modules-available/statistics/inc | |
parent | [backup] Update translations (dozmod -> suite) (diff) | |
download | slx-admin-ab9fbf17cc71d56a01ff82d26af13872b41e5112.tar.gz slx-admin-ab9fbf17cc71d56a01ff82d26af13872b41e5112.tar.xz slx-admin-ab9fbf17cc71d56a01ff82d26af13872b41e5112.zip |
[statistics] Add NVMe support
Diffstat (limited to 'modules-available/statistics/inc')
-rw-r--r-- | modules-available/statistics/inc/parser.inc.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/modules-available/statistics/inc/parser.inc.php b/modules-available/statistics/inc/parser.inc.php index 764d18c1..d697c733 100644 --- a/modules-available/statistics/inc/parser.inc.php +++ b/modules-available/statistics/inc/parser.inc.php @@ -348,7 +348,11 @@ class Parser { continue; } if (preg_match('/^([A-Z][^:]+):\s*(.*)$/', $line, $out)) { - $dev['s_' . preg_replace('/\s|-|_/', '', $out[1])] = $out[2]; + $key = preg_replace('/\s|-|_/', '', $out[1]); + if ($key === 'ModelNumber') { + $key = 'DeviceModel'; + } + $dev['s_' . $key] = $out[2]; } elseif (preg_match('/^\s*\d+\s+(\S+)\s+\S+\s+\d+\s+\d+\s+\S+\s+\S+\s+(\d+)(\s|$)/', $line, $out)) { $dev['s_' . preg_replace('/\s|-|_/', '', $out[1])] = $out[2]; } @@ -357,7 +361,7 @@ class Parser { foreach ($hdds as &$hdd) { if (isset($hdd['s_PowerOnHours'])) { $hdd['PowerOnTime'] = ''; - $val = (int)$hdd['s_PowerOnHours']; + $val = (int)str_replace('.', '', $hdd['s_PowerOnHours']); if ($val > 8760) { $hdd['PowerOnTime'] .= floor($val / 8760) . 'Y, '; $val %= 8760; |