mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added a load tab on device->health
This commit is contained in:
9
html/includes/graphs/device/load.inc.php
Normal file
9
html/includes/graphs/device/load.inc.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
$class = "load";
|
||||
$unit = "%%";
|
||||
$unit_long = "Load";
|
||||
|
||||
include("includes/graphs/device/sensor.inc.php");
|
||||
|
||||
?>
|
23
html/includes/graphs/sensor/load.inc.php
Normal file
23
html/includes/graphs/sensor/load.inc.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
$scale_min = "25";
|
||||
$scale_max = "40";
|
||||
|
||||
include("includes/graphs/common.inc.php");
|
||||
|
||||
$rrd_options .= " COMMENT:' Last Max\\n'";
|
||||
|
||||
$rrd_options .= " DEF:sensor=$rrd_filename:sensor:AVERAGE";
|
||||
$rrd_options .= " DEF:sensor_max=$rrd_filename:sensor:MAX";
|
||||
$rrd_options .= " DEF:sensor_min=$rrd_filename:sensor:MIN";
|
||||
$rrd_options .= " CDEF:sensorcold=sensor_min,20,LT,sensor,UNKN,IF";
|
||||
$rrd_options .= " AREA:sensor_max#c5c5c5";
|
||||
$rrd_options .= " AREA:sensor_min#ffffffff";
|
||||
$rrd_options .= " LINE1:sensor#cc0000:'" . rrdtool_escape($sensor['sensor_descr'],28)."'";
|
||||
$rrd_options .= " GPRINT:sensor:LAST:%3.0lf%%";
|
||||
$rrd_options .= " GPRINT:sensor:MAX:%3.0lf%%\\\\l";
|
||||
|
||||
if (is_numeric($sensor['sensor_limit'])) $rrd_options .= " HRULE:".$sensor['sensor_limit']."#999999::dashes";
|
||||
if (is_numeric($sensor['sensor_limit_low'])) $rrd_options .= " HRULE:".$sensor['sensor_limit_low']."#999999::dashes";
|
||||
|
||||
?>
|
@ -13,8 +13,9 @@ $volts = dbFetchCell("select count(*) from sensors WHERE sensor_class='vo
|
||||
$current = dbFetchCell("select count(*) from sensors WHERE sensor_class='current' AND device_id = ?", array($device['device_id']));
|
||||
$freqs = dbFetchCell("select count(*) from sensors WHERE sensor_class='frequency' AND device_id = ?", array($device['device_id']));
|
||||
$power = dbFetchCell("select count(*) from sensors WHERE sensor_class='power' AND device_id = ?", array($device['device_id']));
|
||||
$dBm = dbFetchCell("select count(*) from sensors WHERE sensor_class='dBm' AND device_id = ?", array($device['device_id']));
|
||||
$dBm = dbFetchCell("select count(*) from sensors WHERE sensor_class='dBm' AND device_id = ?", array($device['device_id']));
|
||||
$states = dbFetchCell("select count(*) from sensors WHERE sensor_class='state' AND device_id = ?", array($device['device_id']));
|
||||
$load = dbFetchCell("select count(*) from sensors WHERE sensor_class='load' AND device_id = ?", array($device['device_id']));
|
||||
|
||||
unset($datas);
|
||||
$datas[] = 'overview';
|
||||
@ -32,6 +33,7 @@ if ($current) { $datas[] = 'current'; }
|
||||
if ($power) { $datas[] = 'power'; }
|
||||
if ($dBm) { $datas[] = 'dbm'; }
|
||||
if ($states) { $datas[] = 'state'; }
|
||||
if ($load) { $datas[] = 'load'; }
|
||||
|
||||
$type_text['overview'] = "Overview";
|
||||
$type_text['charge'] = "Battery Charge";
|
||||
@ -48,6 +50,7 @@ $type_text['current'] = "Current";
|
||||
$type_text['power'] = "Power";
|
||||
$type_text['dbm'] = "dBm";
|
||||
$type_text['state'] = "State";
|
||||
$type_text['load'] = "Load";
|
||||
|
||||
$link_array = array('page' => 'device',
|
||||
'device' => $device['device_id'],
|
||||
|
9
html/pages/device/health/load.inc.php
Normal file
9
html/pages/device/health/load.inc.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
$class = "load";
|
||||
$unit = "%";
|
||||
$graph_type = "sensor_load";
|
||||
|
||||
include("sensors.inc.php");
|
||||
|
||||
?>
|
Reference in New Issue
Block a user