mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix ups nut PHP 8.1 issue (#14392)
https://community.librenms.org/t/sensors-initialisation-fails-with-php-8-1/19697
This commit is contained in:
@@ -65,10 +65,10 @@ if (! empty($pre_cache['ups_nut_sensors'])) {
|
||||
];
|
||||
foreach ($sensors as $index => $sensor) {
|
||||
$sensor_oid = 9 + $index;
|
||||
$oid = '.1.3.6.1.4.1.8072.1.3.2.4.1.2.7.117.112.115.45.110.117.116.' . strval($sensor_oid);
|
||||
$value = current($pre_cache['ups_nut_sensors']['ups-nut.' . $sensor_oid]);
|
||||
|
||||
if (! empty($value) or $value == '0') {
|
||||
if (! empty($pre_cache['ups_nut_sensors']['ups-nut.' . $sensor_oid])) {
|
||||
$oid = '.1.3.6.1.4.1.8072.1.3.2.4.1.2.7.117.112.115.45.110.117.116.' . $sensor_oid;
|
||||
$value = current($pre_cache['ups_nut_sensors']['ups-nut.' . $sensor_oid]);
|
||||
$state_name = $sensor['state_name'];
|
||||
$descr = $sensor['descr'];
|
||||
$states = [
|
||||
|
||||
Reference in New Issue
Block a user