new sensors for siteboss OS + new sensor type: percentage (%) (#11958)

* split siteboss 530 and 550 into multiple OS

* add more sensors to siteboss550 and new Percent sensor

* fix contact closure event state values

* split os polling for siteboss to siteboss530 and siteboss550

* add test unit for siteboss550, rename test unit for siteboss to siteboss530

* refactor siteboss os polling to \Librenms\OS

* implement OSPolling to Sitebos550

* force save in pollOS() to keep custom sysName during polling

* updated unit test

* update device graphs

* remove pollOS and extra save()

* siteboss550 no longer extends OSPolling

* update siteboss550 test data

* update discoverOS() to match recent os discovery changes

* styleCI changes

* fix siteboss hardware discovery; add check to OS polling if os_group .inc file exists

* collapse siteboss to single OS, implement siteboss sensors in advanced discovery

* add siteboss unit tests

* removed unneeded OS disco defs

* styleCI changes

* more styleCI changes

* split siteboss os to siteboss530 and siteboss550

* split siteboss os to siteboss530 and siteboss550

* move php polling back into yaml

* keep original siteboss OS name

* resave snmp data for siteboss OS

* resave snmp data for siteboss550 OS
This commit is contained in:
Hayden
2020-10-20 17:11:12 -07:00
committed by GitHub
parent f822567186
commit 397a10e73f
24 changed files with 29129 additions and 274 deletions

View File

@@ -0,0 +1,7 @@
<?php
$class = 'percent';
$unit = '%%';
$unit_long = 'Percent';
require 'includes/html/graphs/device/sensor.inc.php';

View File

@@ -0,0 +1,23 @@
<?php
require 'includes/html/graphs/common.inc.php';
$rrd_options .= " COMMENT:' Min Last Max\\n'";
$sensor['sensor_descr_fixed'] = rrdtool_escape($sensor['sensor_descr'], 15);
$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 .= " LINE1.5:sensor#cc0000:'" . $sensor['sensor_descr_fixed'] . "'";
$rrd_options .= " GPRINT:sensor_min$current_id:MIN:%4.1lf";
$rrd_options .= ' GPRINT:sensor:LAST:%4.1lf';
$rrd_options .= ' GPRINT:sensor_max:MAX:%4.1lf\\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';
}

View File

@@ -43,6 +43,7 @@ $chromatic_dispersion = dbFetchCell("select count(*) from sensors WHERE sensor_c
$ber = dbFetchCell("select count(*) from sensors WHERE sensor_class='ber' AND device_id = ?", [$device['device_id']]);
$eer = dbFetchCell("select count(*) from sensors WHERE sensor_class='eer' AND device_id = ?", [$device['device_id']]);
$waterflow = dbFetchCell("select count(*) from sensors WHERE sensor_class='waterflow' AND device_id = ?", [$device['device_id']]);
$percent = dbFetchCell("select count(*) from sensors WHERE sensor_class='percent' AND device_id = ?", [$device['device_id']]);
unset($datas);
$datas[] = 'overview';
@@ -174,6 +175,10 @@ if ($loss) {
$datas[] = 'loss';
}
if ($percent) {
$datas[] = 'percent';
}
$type_text['overview'] = 'Overview';
$type_text['charge'] = 'Battery Charge';
$type_text['temperature'] = 'Temperature';
@@ -207,6 +212,7 @@ $type_text['eer'] = 'Energy Efficiency Ratio';
$type_text['waterflow'] = 'Water Flow Rate';
$type_text['loss'] = 'Loss';
$type_text['qfp'] = 'QFP';
$type_text['percent'] = 'Percent';
$link_array = [
'page' => 'device',

View File

@@ -0,0 +1,7 @@
<?php
$class = 'percent';
$unit = '%';
$graph_type = 'sensor_percent';
require 'sensors.inc.php';

View File

@@ -57,6 +57,7 @@ require 'overview/sensors/frequency.inc.php';
require 'overview/sensors/load.inc.php';
require 'overview/sensors/state.inc.php';
require 'overview/sensors/count.inc.php';
require 'overview/sensors/percent.inc.php';
require 'overview/sensors/signal.inc.php';
require 'overview/sensors/airflow.inc.php';
require 'overview/sensors/snr.inc.php';

View File

@@ -0,0 +1,8 @@
<?php
$graph_type = 'sensor_percent';
$sensor_class = 'percent';
$sensor_unit = '%';
$sensor_type = 'Percent';
require 'includes/html/pages/device/overview/generic/sensor.inc.php';

View File

@@ -59,6 +59,7 @@ $type_text = [
'ber' => 'Bit Error Rate',
'eer' => 'Energy Efficiency Ratio',
'waterflow' => 'Water Flow Rate',
'percent' => 'Percent',
];
$active_metric = basename($vars['metric'] ?? 'processor');

View File

@@ -0,0 +1,7 @@
<?php
$graph_type = 'sensor_percent';
$class = 'percent';
$unit = '%';
require 'includes/html/pages/health/sensors.inc.php';