mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added Signal Sensor
This commit is contained in:
@@ -1371,6 +1371,18 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) {
|
||||
'GPRINT:temp_avg:AVERAGE:%4.1lf',
|
||||
'GPRINT:temp_max:MAX:%4.1lf',
|
||||
'GPRINT:temp_avg:LAST:%4.1lf\l');
|
||||
$GraphDefs['signal'] = array(
|
||||
'DEF:signal_avg={file}:value:AVERAGE',
|
||||
'DEF:signal_min={file}:value:MIN',
|
||||
'DEF:signal_max={file}:value:MAX',
|
||||
'CDEF:average=signal_avg,0.2,*,PREV,UN,signal_avg,PREV,IF,0.8,*,+',
|
||||
"AREA:signal_max#$HalfRed",
|
||||
"AREA:signal_min#$Canvas",
|
||||
"LINE1:signal_avg#$FullRed:Signal",
|
||||
'GPRINT:signal_min:MIN:%4.1lf',
|
||||
'GPRINT:signal_avg:AVERAGE:%4.1lf',
|
||||
'GPRINT:signal_max:MAX:%4.1lf',
|
||||
'GPRINT:signal_avg:LAST:%4.1lf\l');
|
||||
$GraphDefs['timeleft'] = array(
|
||||
#'-v', 'Minutes',
|
||||
'DEF:avg={file}:timeleft:AVERAGE',
|
||||
|
7
html/includes/graphs/device/signal.inc.php
Normal file
7
html/includes/graphs/device/signal.inc.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
$class = 'signal';
|
||||
$unit = 'dBm';
|
||||
$unit_long = '';
|
||||
|
||||
require 'includes/graphs/device/sensor.inc.php';
|
22
html/includes/graphs/sensor/signal.inc.php
Normal file
22
html/includes/graphs/sensor/signal.inc.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
$scale_min = '-100';
|
||||
$scale_max = '0';
|
||||
require 'includes/graphs/common.inc.php';
|
||||
|
||||
$rrd_options .= " COMMENT:' Min Last Max\\n'";
|
||||
|
||||
$sensor['sensor_descr_fixed'] = substr(str_pad($sensor['sensor_descr'], 18), 0, 18);
|
||||
|
||||
$rrd_options .= " DEF:sensor=$rrd_filename:sensor:AVERAGE";
|
||||
$rrd_options .= " LINE1.5:sensor#cc0000:'".$sensor['sensor_descr_fixed']."'";
|
||||
$rrd_options .= " GPRINT:sensor$current_id:MIN:%5.2lfdBm";
|
||||
$rrd_options .= ' GPRINT:sensor:LAST:%5.2lfdBm';
|
||||
$rrd_options .= ' GPRINT:sensor:MAX:%5.2lfdBm\\\\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';
|
||||
}
|
@@ -359,8 +359,8 @@ if ($menu_sensors) {
|
||||
echo(' <li role="presentation" class="divider"></li>');
|
||||
}
|
||||
|
||||
$icons = array('fanspeed'=>'tachometer','humidity'=>'tint','temperature'=>'fire','current'=>'bolt','frequency'=>'line-chart','power'=>'power-off','voltage'=>'bolt','charge'=>'plus-square','dbm'=>'sun-o', 'load'=>'spinner','state'=>'bullseye');
|
||||
foreach (array('fanspeed','humidity','temperature') as $item) {
|
||||
$icons = array('fanspeed'=>'tachometer','humidity'=>'tint','temperature'=>'fire','current'=>'bolt','frequency'=>'line-chart','power'=>'power-off','voltage'=>'bolt','charge'=>'plus-square','dbm'=>'sun-o', 'load'=>'spinner','state'=>'bullseye','signal'=>'wifi');
|
||||
foreach (array('fanspeed','humidity','temperature','signal') as $item) {
|
||||
if (isset($menu_sensors[$item])) {
|
||||
echo(' <li><a href="health/metric='.$item.'/"><i class="fa fa-'.$icons[$item].' fa-fw fa-lg"></i> '.nicecase($item).'</a></li>');
|
||||
unset($menu_sensors[$item]);$sep++;
|
||||
|
Reference in New Issue
Block a user