summaryrefslogtreecommitdiffstats
path: root/modules-available
diff options
context:
space:
mode:
authorSimon Rettberg2019-12-13 15:19:55 +0100
committerSimon Rettberg2019-12-13 15:19:55 +0100
commitab9fbf17cc71d56a01ff82d26af13872b41e5112 (patch)
treeba373b0a69f6b705e3587d4b11fb663a57b9d0db /modules-available
parent[backup] Update translations (dozmod -> suite) (diff)
downloadslx-admin-ab9fbf17cc71d56a01ff82d26af13872b41e5112.tar.gz
slx-admin-ab9fbf17cc71d56a01ff82d26af13872b41e5112.tar.xz
slx-admin-ab9fbf17cc71d56a01ff82d26af13872b41e5112.zip
[statistics] Add NVMe support
Diffstat (limited to 'modules-available')
-rw-r--r--modules-available/statistics/inc/parser.inc.php8
-rw-r--r--modules-available/statistics/templates/machine-hdds.html3
2 files changed, 9 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;
diff --git a/modules-available/statistics/templates/machine-hdds.html b/modules-available/statistics/templates/machine-hdds.html
index b839dfca..4d0409f9 100644
--- a/modules-available/statistics/templates/machine-hdds.html
+++ b/modules-available/statistics/templates/machine-hdds.html
@@ -19,6 +19,9 @@
{{#s_PowerOnHours}}
<div>{{lang_powerOnTime}}: {{s_PowerOnHours}}&thinsp;{{lang_hours}} ({{PowerOnTime}})</div>
{{/s_PowerOnHours}}
+ {{#s_MediaandDataIntegrityErrors}}
+ <div class="red">{{lang_mediaIntegrityErrors}}: {{s_MediaandDataIntegrityErrors}}</div>
+ {{/s_MediaandDataIntegrityErrors}}
<div class="row">
<div class="col-sm-7">
<table class="table table-condensed table-striped table-responsive">