Files
librenms-librenms/includes/discovery/sensors/charge/rfc1628.inc.php
Tony Murray f15f8fa63a Sensors remove reliance on global variable (#16344)
* Sensors remove reliance on global variable

* Apply fixes from StyleCI

* Clear the instance instead of reset.
Remove $valid['sensors'] from docs

---------

Co-authored-by: Tony Murray <murrant@users.noreply.github.com>
2024-09-03 21:04:34 -05:00

26 lines
418 B
PHP

<?php
// RFC1628 UPS
echo 'RFC1628 ';
$value = snmp_get($device, 'upsEstimatedChargeRemaining.0', '-OvqU', 'UPS-MIB');
if (is_numeric($value)) {
discover_sensor(
null,
'charge',
$device,
'.1.3.6.1.2.1.33.1.2.4.0',
500,
'rfc1628',
'Battery charge remaining',
1,
1,
15,
50,
null,
101,
$value
);
}