mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
* 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>
26 lines
418 B
PHP
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
|
|
);
|
|
}
|