smart application database update fix (#10378)

* fix database filling

* Update smart.inc.php

* Update smart.inc.php
This commit is contained in:
SourceDoctor 2019-06-26 16:47:39 +02:00 committed by Tony Murray
parent dd2fc0baf8
commit 932d338a83
1 changed files with 4 additions and 11 deletions

View File

@ -132,28 +132,21 @@ while (isset($lines[$int])) {
$int++;
}
# smart enhancement id9
# 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;
$fields = ['id9' => $id9];
$metrics[$disk]['id9'] = $id9;
$tags = array('name' => $name, 'app_id' => $app_id, 'rrd_def' => $rrd_def, 'rrd_name' => $rrd_name);
data_update($device, 'app', $tags, $fields);