enhance smart to show power_on_hours also (#10261)

This commit is contained in:
SourceDoctor
2019-06-07 06:39:23 +02:00
committed by Tony Murray
parent e6ad2b5bb8
commit 349e102b73
6 changed files with 73 additions and 1 deletions

View File

@@ -13,10 +13,17 @@ if (isset($vars['disk'])) {
$disks=get_disks_with_smart($device, $app['app_id']);
}
$smart_enhancements = array('id9');
$int=0;
while (isset($disks[$int])) {
$disk=$disks[$int];
$rrd_filename = rrd_name($device['hostname'], array('app', $name, $app_id, $disk));
if (in_array($rrdVar, $smart_enhancements)) {
$rrd_filename = rrd_name($device['hostname'], array('app', $name.'_'.$rrdVar, $app_id, $disk));
} else {
$rrd_filename = rrd_name($device['hostname'], array('app', $name, $app_id, $disk));
}
if (rrdtool_check_rrd_exists($rrd_filename)) {
$rrd_list[]=array(

View File

@@ -0,0 +1,9 @@
<?php
$unit_text = 'Power On Hours';
$unitlen = 20;
$bigdescrlen = 15;
$smalldescrlen = 15;
$rrdVar='id9';
require 'smart-common.inc.php';

View File

@@ -0,0 +1,24 @@
<?php
$name = 'smart';
$app_id = $app['app_id'];
$unit_text = '';
$unitlen = 20;
$bigdescrlen = 15;
$smalldescrlen = 15;
$colours = 'mega';
$dostack = 0;
$printtotal = 0;
$addarea = 1;
$transparency = 15;
$rrd_filename = rrd_name($device['hostname'], array('app', $name, $app_id, $vars['disk']));
if (rrdtool_check_rrd_exists($rrd_filename)) {
$rrd_list[]=array(
'filename' => $rrd_filename,
'descr' => 'Power On Hours',
'ds' => 'id9',
);
}
require 'includes/html/graphs/generic_multi_line_exact_numbers.inc.php';