mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix combined sensor graphs on health tab
git-svn-id: http://www.observium.org/svn/observer/trunk@1776 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@ -41,13 +41,12 @@ while($current = mysql_fetch_array($sql))
|
||||
|
||||
$descr = substr(str_pad($current['sensor_descr'], 15),0,15);
|
||||
$rrd_filename = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("current-" . $current['sensor_descr'] . ".rrd");
|
||||
$current_id = $current['sensor_id'];
|
||||
|
||||
$rrd_options .= " DEF:current$current_id=$rrd_filename:current:AVERAGE";
|
||||
$rrd_options .= " LINE1:current$current_id#".$colour.":'" . $descr . "'";
|
||||
$rrd_options .= " GPRINT:current$current_id:AVERAGE:%5.2lfA";
|
||||
$rrd_options .= " GPRINT:current$current_id:MIN:%5.2lfA";
|
||||
$rrd_options .= " GPRINT:current$current_id:MAX:%5.2lfA\\\\l";
|
||||
$rrd_options .= " DEF:sensor" . $current['sensor_id'] . "=$rrd_filename:sensor:AVERAGE";
|
||||
$rrd_options .= " LINE1:sensor" . $current['sensor_id'] . "#".$colour.":'" . $descr . "'";
|
||||
$rrd_options .= " GPRINT:sensor" . $current['sensor_id'] . ":AVERAGE:%5.2lfA";
|
||||
$rrd_options .= " GPRINT:sensor" . $current['sensor_id'] . ":MIN:%5.2lfA";
|
||||
$rrd_options .= " GPRINT:sensor" . $current['sensor_id'] . ":MAX:%5.2lfA\\\\l";
|
||||
|
||||
$iter++;
|
||||
}
|
||||
|
@ -39,14 +39,14 @@ while($fanspeed = mysql_fetch_array($sql))
|
||||
}
|
||||
|
||||
$descr = substr(str_pad($fanspeed['sensor_descr'], 17),0,17);
|
||||
$rrd_filename = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("fan-" . $fanspeed['sensor_descr'] . ".rrd");
|
||||
$rrd_filename = $config['rrd_dir'] . "/".$device['hostname']."/" . safename("fanspeed-" . safename($fanspeed['sensor_type']."-".$fanspeed['sensor_index']) . ".rrd");
|
||||
$fan_id = $fanspeed['sensor_id'];
|
||||
|
||||
$rrd_options .= " DEF:fan$fan_id=$rrd_filename:fan:AVERAGE";
|
||||
$rrd_options .= " LINE1:fan$fan_id#".$colour.":'" . $descr . "'";
|
||||
$rrd_options .= " GPRINT:fan$fan_id:AVERAGE:%5.0lf\ ";
|
||||
$rrd_options .= " GPRINT:fan$fan_id:MIN:%5.0lf\ ";
|
||||
$rrd_options .= " GPRINT:fan$fan_id:MAX:%5.0lf\\\\l";
|
||||
$rrd_options .= " DEF:sensor$fan_id=$rrd_filename:sensor:AVERAGE";
|
||||
$rrd_options .= " LINE1:sensor$fan_id#".$colour.":'" . $descr . "'";
|
||||
$rrd_options .= " GPRINT:sensor$fan_id:AVERAGE:%5.0lf\ ";
|
||||
$rrd_options .= " GPRINT:sensor$fan_id:MIN:%5.0lf\ ";
|
||||
$rrd_options .= " GPRINT:sensor$fan_id:MAX:%5.0lf\\\\l";
|
||||
|
||||
$iter++;
|
||||
}
|
||||
|
@ -38,12 +38,12 @@ while($humidity = mysql_fetch_array($sql))
|
||||
}
|
||||
|
||||
$humidity['sensor_descr_fixed'] = substr(str_pad($humidity['sensor_descr'], 22),0,22);
|
||||
$humidityrrd = $config['rrd_dir'] . "/".$device['hostname']."/".safename("humidity-" . $humidity['sensor_descr'] . ".rrd");
|
||||
$rrd_options .= " DEF:humidity" . $humidity['sensor_id'] . "=$humidityrrd:humidity:AVERAGE ";
|
||||
$rrd_options .= " LINE1:humidity" . $humidity['sensor_id'] . "#" . $colour . ":'" . str_replace(':','\:',str_replace('\*','*',quotemeta($humidity['sensor_descr_fixed']))) . "' ";
|
||||
$rrd_options .= " GPRINT:humidity" . $humidity['sensor_id'] . ":LAST:%3.0lf%% ";
|
||||
$rrd_options .= " GPRINT:humidity" . $humidity['sensor_id'] . ":MIN:%3.0lf%% ";
|
||||
$rrd_options .= " GPRINT:humidity" . $humidity['sensor_id'] . ":MAX:%3.0lf%%\\\l ";
|
||||
$humidityrrd = $config['rrd_dir'] . "/".$device['hostname']."/".safename("humidity-" . safename($humidity['sensor_type']."-".$humidity['sensor_index']) . ".rrd");
|
||||
$rrd_options .= " DEF:sensor" . $humidity['sensor_id'] . "=$humidityrrd:sensor:AVERAGE ";
|
||||
$rrd_options .= " LINE1:sensor" . $humidity['sensor_id'] . "#" . $colour . ":'" . str_replace(':','\:',str_replace('\*','*',quotemeta($humidity['sensor_descr_fixed']))) . "' ";
|
||||
$rrd_options .= " GPRINT:sensor" . $humidity['sensor_id'] . ":LAST:%3.0lf%% ";
|
||||
$rrd_options .= " GPRINT:sensor" . $humidity['sensor_id'] . ":MIN:%3.0lf%% ";
|
||||
$rrd_options .= " GPRINT:sensor" . $humidity['sensor_id'] . ":MAX:%3.0lf%%\\\l ";
|
||||
$iter++;
|
||||
}
|
||||
|
||||
|
@ -39,12 +39,12 @@ while($temperature = mysql_fetch_array($sql))
|
||||
}
|
||||
|
||||
$temperature['sensor_descr_fixed'] = substr(str_pad($temperature['sensor_descr'], $descr_len),0,$descr_len);
|
||||
$rrd_file = $config['rrd_dir'] . "/" . $device['hostname'] . "/temp-" . safename($temperature['sensor_type']."-".$temperature['sensor_index']) . ".rrd";
|
||||
$rrd_options .= " DEF:temp" . $temperature['sensor_id'] . "=$rrd_file:temp:AVERAGE ";
|
||||
$rrd_options .= " LINE1:temp" . $temperature['sensor_id'] . "#" . $colour . ":'" . str_replace(':','\:',str_replace('\*','*',$temperature['sensor_descr_fixed'])) . "'";
|
||||
$rrd_options .= " GPRINT:temp" . $temperature['sensor_id'] . ":LAST:%4.1lfC ";
|
||||
$rrd_options .= " GPRINT:temp" . $temperature['sensor_id'] . ":MIN:%4.1lfC ";
|
||||
$rrd_options .= " GPRINT:temp" . $temperature['sensor_id'] . ":MAX:%4.1lfC\\\l ";
|
||||
$rrd_file = $config['rrd_dir'] . "/" . $device['hostname'] . "/temperature-" . safename($temperature['sensor_type']."-".$temperature['sensor_index']) . ".rrd";
|
||||
$rrd_options .= " DEF:sensor" . $temperature['sensor_id'] . "=$rrd_file:sensor:AVERAGE ";
|
||||
$rrd_options .= " LINE1:sensor" . $temperature['sensor_id'] . "#" . $colour . ":'" . str_replace(':','\:',str_replace('\*','*',$temperature['sensor_descr_fixed'])) . "'";
|
||||
$rrd_options .= " GPRINT:sensor" . $temperature['sensor_id'] . ":LAST:%4.1lfC ";
|
||||
$rrd_options .= " GPRINT:sensor" . $temperature['sensor_id'] . ":MIN:%4.1lfC ";
|
||||
$rrd_options .= " GPRINT:sensor" . $temperature['sensor_id'] . ":MAX:%4.1lfC\\\l ";
|
||||
$iter++;
|
||||
}
|
||||
|
||||
|
@ -43,14 +43,13 @@ while($sensor = mysql_fetch_array($sql))
|
||||
$sensor['sensor_descr_fixed'] = substr(str_pad($sensor['sensor_descr'], $descr_len),0,$descr_len);
|
||||
$sensor['sensor_descr_fixed'] = str_replace(':','\:',str_replace('\*','*',$sensor['sensor_descr_fixed']));
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/volt-" . safename($sensor['sensor_type']."-".$sensor['sensor_index']) . ".rrd";
|
||||
$sensor_id = $sensor['sensor_id'];
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/voltage-" . safename($sensor['sensor_type']."-".$sensor['sensor_index']) . ".rrd";
|
||||
|
||||
$rrd_options .= " DEF:s$sensor_id=$rrd_filename:volt:AVERAGE";
|
||||
$rrd_options .= " LINE1:s$sensor_id#".$colour.":'" . $sensor['sensor_descr_fixed'] . "'";
|
||||
$rrd_options .= " GPRINT:s$sensor_id:AVERAGE:%5.2lfV";
|
||||
$rrd_options .= " GPRINT:s$sensor_id:MIN:%5.2lfV";
|
||||
$rrd_options .= " GPRINT:s$sensor_id:MAX:%5.2lfV\\\\l";
|
||||
$rrd_options .= " DEF:sensor" . $sensor['sensor_id'] . "=$rrd_filename:sensor:AVERAGE";
|
||||
$rrd_options .= " LINE1:sensor" . $sensor['sensor_id'] . "#".$colour.":'" . $sensor['sensor_descr_fixed'] . "'";
|
||||
$rrd_options .= " GPRINT:sensor" . $sensor['sensor_id'] . ":AVERAGE:%5.2lfV";
|
||||
$rrd_options .= " GPRINT:sensor" . $sensor['sensor_id'] . ":MIN:%5.2lfV";
|
||||
$rrd_options .= " GPRINT:sensor" . $sensor['sensor_id'] . ":MAX:%5.2lfV\\\\l";
|
||||
|
||||
$iter++;
|
||||
}
|
||||
|
@ -28,7 +28,8 @@ if(is_numeric($_GET['optd'])) { $to = $_GET['optd']; } else { $to = $now; }
|
||||
include("includes/error-no-perm.inc.php");
|
||||
} else {
|
||||
|
||||
if(isset($config['graph'][$type][$subtype])) { $title .= " :: ".$config['graph'][$type][$subtype]; } else { $title .= " :: ".$graph_type; }
|
||||
# Do we really need to show the type? User does not have to see the type of graph (i.e. sensor_temperature)
|
||||
# if(isset($config['graph'][$type][$subtype])) { $title .= " :: ".$config['graph'][$type][$subtype]; } else { $title .= " :: ".$graph_type; }
|
||||
|
||||
$graph_array['height'] = "60";
|
||||
$graph_array['width'] = "150";
|
||||
@ -96,7 +97,6 @@ if(is_numeric($_GET['optd'])) { $to = $_GET['optd']; } else { $to = $now; }
|
||||
echo(" </a>
|
||||
</div>");
|
||||
|
||||
|
||||
$graph_array['from'] = $year;
|
||||
echo("<div style='width: 150px; margin: 0px 10px 5px 0px; padding:5px; background: #e5e5e5; float: left;'>
|
||||
<span class=device-head>Year</span><br />
|
||||
|
Reference in New Issue
Block a user