2017-03-22 09:28:50 -05:00
|
|
|
<?php
|
|
|
|
|
2021-04-29 05:00:32 +02:00
|
|
|
$disks = Rrd::getRrdApplicationArrays($device, $app['app_id'], 'smart');
|
2017-03-22 09:28:50 -05:00
|
|
|
|
|
|
|
print_optionbar_start();
|
|
|
|
|
2020-09-21 15:40:17 +02:00
|
|
|
$link_array = [
|
2017-03-22 09:28:50 -05:00
|
|
|
'page' => 'device',
|
|
|
|
'device' => $device['device_id'],
|
|
|
|
'tab' => 'apps',
|
|
|
|
'app' => 'smart',
|
2020-09-21 15:40:17 +02:00
|
|
|
];
|
2017-03-22 09:28:50 -05:00
|
|
|
|
2020-09-21 15:40:17 +02:00
|
|
|
$drives = [];
|
2017-03-22 09:28:50 -05:00
|
|
|
|
2018-03-13 15:26:23 +02:00
|
|
|
foreach ($disks as $label) {
|
|
|
|
$disk = $label;
|
2017-03-22 09:28:50 -05:00
|
|
|
|
|
|
|
if ($vars['disk'] == $disk) {
|
2018-03-13 15:26:23 +02:00
|
|
|
$label = sprintf('⚫ %s', $label);
|
2017-03-22 09:28:50 -05:00
|
|
|
}
|
|
|
|
|
2020-09-21 15:40:17 +02:00
|
|
|
array_push($drives, generate_link($label, $link_array, ['disk'=>$disk]));
|
2017-03-22 09:28:50 -05:00
|
|
|
}
|
|
|
|
|
2020-09-21 15:59:34 +02:00
|
|
|
printf('%s | drives: %s', generate_link('All Drives', $link_array), implode(', ', $drives));
|
2018-03-13 15:26:23 +02:00
|
|
|
|
2017-03-22 09:28:50 -05:00
|
|
|
print_optionbar_end();
|
|
|
|
|
|
|
|
if (isset($vars['disk'])) {
|
2020-09-21 15:40:17 +02:00
|
|
|
$graphs = [
|
2018-03-13 15:26:23 +02:00
|
|
|
'smart_big5' => 'Reliability / Age',
|
|
|
|
'smart_temp' => 'Temperature',
|
|
|
|
'smart_ssd' => 'SSD-specific',
|
|
|
|
'smart_other' => 'Other',
|
|
|
|
'smart_tests_status'=> 'S.M.A.R.T self-tests results',
|
|
|
|
'smart_tests_ran' => 'S.M.A.R.T self-tests run count',
|
2019-06-07 06:39:23 +02:00
|
|
|
'smart_runtime' => 'Power On Hours',
|
2020-09-21 15:40:17 +02:00
|
|
|
];
|
2017-03-22 09:28:50 -05:00
|
|
|
} else {
|
2020-09-21 15:40:17 +02:00
|
|
|
$graphs = [
|
2017-03-22 09:28:50 -05:00
|
|
|
'smart_id5'=>'ID# 5, Reallocated Sectors Count',
|
2019-06-07 06:39:23 +02:00
|
|
|
'smart_id9'=>'ID# 9, Power On Hours',
|
2017-03-22 09:28:50 -05:00
|
|
|
'smart_id10'=>'ID# 10, Spin Retry Count',
|
2018-03-13 15:26:23 +02:00
|
|
|
'smart_id173'=>'ID# 173, SSD Wear Leveller Worst Case Erase Count',
|
|
|
|
'smart_id177'=>'ID# 177, SSD Wear Leveling Count',
|
|
|
|
'smart_id183'=>'ID# 183, Detected Uncorrectable Bad Blocks',
|
2017-03-22 09:28:50 -05:00
|
|
|
'smart_id184'=>'ID# 184, End-to-End error / IOEDC',
|
|
|
|
'smart_id187'=>'ID# 187, Reported Uncorrectable Errors',
|
|
|
|
'smart_id188'=>'ID# 188, Command Timeout',
|
|
|
|
'smart_id190'=>'ID# 190, Airflow Temperature (C)',
|
|
|
|
'smart_id194'=>'ID# 194, Temperature (C)',
|
|
|
|
'smart_id196'=>'ID# 196, Reallocation Event Count',
|
|
|
|
'smart_id197'=>'ID# 197, Current Pending Sector Count',
|
2018-03-13 15:26:23 +02:00
|
|
|
'smart_id198'=>'ID# 198, Uncorrectable Sector Count / Offline Uncorrectable / Off-Line Scan Uncorrectable Sector Count',
|
2017-03-22 09:28:50 -05:00
|
|
|
'smart_id199'=>'ID# 199, UltraDMA CRC Error Count',
|
|
|
|
'smart_id231'=>'ID# 231, SSD Life Left',
|
2020-09-21 15:40:17 +02:00
|
|
|
'smart_id233'=>'ID# 233, Media Wearout Indicator',
|
|
|
|
];
|
2017-03-22 09:28:50 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
foreach ($graphs as $key => $text) {
|
2020-09-21 15:40:17 +02:00
|
|
|
$graph_type = $key;
|
2017-03-22 09:28:50 -05:00
|
|
|
$graph_array['height'] = '100';
|
2020-09-21 15:40:17 +02:00
|
|
|
$graph_array['width'] = '215';
|
2019-06-23 00:29:12 -05:00
|
|
|
$graph_array['to'] = \LibreNMS\Config::get('time.now');
|
2020-09-21 15:40:17 +02:00
|
|
|
$graph_array['id'] = $app['app_id'];
|
|
|
|
$graph_array['type'] = 'application_' . $key;
|
2017-03-22 09:28:50 -05:00
|
|
|
|
|
|
|
if (isset($vars['disk'])) {
|
2020-09-21 15:40:17 +02:00
|
|
|
$graph_array['disk'] = $vars['disk'];
|
2017-03-22 09:28:50 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
echo '<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
2020-09-21 15:40:17 +02:00
|
|
|
<h3 class="panel-title">' . $text . '</h3>
|
2017-03-22 09:28:50 -05:00
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<div class="row">';
|
2019-04-11 23:26:42 -05:00
|
|
|
include 'includes/html/print-graphrow.inc.php';
|
2017-03-22 09:28:50 -05:00
|
|
|
echo '</div>';
|
|
|
|
echo '</div>';
|
|
|
|
echo '</div>';
|
|
|
|
}
|