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

@@ -131,4 +131,33 @@ while (isset($lines[$int])) {
$int++;
}
# smart enhancement id9
$rrd_name = array('app', $name, $app_id);
$rrd_def = RrdDefinition::make()
->addDataset('id9', 'GAUGE', 0);
$int=0;
$metrics = array();
while (isset($lines[$int])) {
list($disk, , , , , , , , , , , , , , , , , , , , , , , , , $id9)=explode(",", $lines[$int]);
if (is_int($id9)) {
$id=null;
}
$rrd_name = array('app', $name.'_id9', $app_id, $disk);
$fields = array(
'id9'=>$id9
);
$metrics[$disk] = $fields;
$tags = array('name' => $name, 'app_id' => $app_id, 'rrd_def' => $rrd_def, 'rrd_name' => $rrd_name);
data_update($device, 'app', $tags, $fields);
$int++;
}
update_application($app, $output, $metrics);