Files
librenms-librenms/includes/html/graphs/sensor/percent.inc.php
Hayden 397a10e73f 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
2020-10-20 19:11:12 -05:00

24 lines
882 B
PHP

<?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';
}