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>
16 lines
439 B
PHP
16 lines
439 B
PHP
<?php
|
|
|
|
// input current
|
|
$oids = snmp_get($device, '.1.3.6.1.4.1.3808.1.1.3.2.3.1.1.2.1', '-OsqnU');
|
|
d_echo($oids . "\n");
|
|
|
|
if ($oids) {
|
|
echo ' Cyberpower Input Current';
|
|
[$oid, $current] = explode(' ', $oids);
|
|
$divisor = 10;
|
|
$type = 'cyberpower';
|
|
$descr = 'Input';
|
|
$current = $current / 10;
|
|
discover_sensor(null, 'current', $device, $oid, '0', $type, $descr, $divisor, '1', null, null, null, null, $current);
|
|
}
|