mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
refactor: Tidy up sensor discovery (#5550)
* refactor: Tidy up sensor discovery * more files * removed uneeded files * updated array check * updates for linux/supermicro * small changes * Update linux.inc.php * Add supermicro temps back to linux.inc.php * No need for is_file on rfc1628.inc.php, it exists * Revert rfc1628 change * Fix whitespace... * rebased * fixed $valid data not being passed to new sensors() function
This commit is contained in:
committed by
Tony Murray
parent
008af4cea0
commit
d4e8c54516
@@ -1,19 +1,17 @@
|
||||
<?php
|
||||
// APC
|
||||
if ($device['os'] == 'apc') {
|
||||
$oids = snmp_get($device, '.1.3.6.1.4.1.318.1.1.1.2.2.3.0', '-OsqnUt', '');
|
||||
d_echo($oids."\n");
|
||||
if ($oids) {
|
||||
echo ' APC Runtime ';
|
||||
list($oid,$current) = explode(' ', $oids);
|
||||
$divisor = 6000;
|
||||
$type = 'apc';
|
||||
$index = 'upsAdvBatteryRunTimeRemaining.0';
|
||||
$descr = 'Runtime';
|
||||
$low_limit = 5;
|
||||
$low_limit_warn = 10;
|
||||
$warn_limit = 2000;
|
||||
$high_limit = 3000;
|
||||
discover_sensor($valid['sensor'], 'runtime', $device, $oid, $index, $type, $descr, $divisor, '1', $low_limit, $low_limit_warn, $warn_limit, $high_limit, $current);
|
||||
}
|
||||
}//end if
|
||||
|
||||
$oids = snmp_get($device, '.1.3.6.1.4.1.318.1.1.1.2.2.3.0', '-OsqnUt', '');
|
||||
d_echo($oids."\n");
|
||||
if ($oids) {
|
||||
echo ' APC Runtime ';
|
||||
list($oid,$current) = explode(' ', $oids);
|
||||
$divisor = 6000;
|
||||
$type = 'apc';
|
||||
$index = 'upsAdvBatteryRunTimeRemaining.0';
|
||||
$descr = 'Runtime';
|
||||
$low_limit = 5;
|
||||
$low_limit_warn = 10;
|
||||
$warn_limit = 2000;
|
||||
$high_limit = 3000;
|
||||
discover_sensor($valid['sensor'], 'runtime', $device, $oid, $index, $type, $descr, $divisor, '1', $low_limit, $low_limit_warn, $warn_limit, $high_limit, $current);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user