mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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>
This commit is contained in:
@@ -28,6 +28,6 @@ foreach ($pre_cache['cooling_unit_analog'] as $index => $data) {
|
||||
$scale = $data['coolingUnitStatusAnalogScale'] ?? null;
|
||||
$value = $data['coolingUnitStatusAnalogValue'] ?? null;
|
||||
if (preg_match('/Fan Speed/', $descr) && $data['coolingUnitStatusAnalogUnits'] == '%' && $value >= 0) {
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $cur_oid, $cur_oid, 'apc', $descr, $scale, 1, null, null, null, null, $value);
|
||||
discover_sensor(null, 'fanspeed', $device, $cur_oid, $cur_oid, 'apc', $descr, $scale, 1, null, null, null, null, $value);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user