I recently upgraded to PHP8.1 and I’m getting an error when running discovery against a Raspberry Pi running OSMC.
State: Error discovering sensors module for 192.168.10.107. TypeError: current(): Argument #1 ($array) must be of type array, null given in /opt/librenms/includes/discovery/sensors/state/linux.inc.php:30
Stack trace:
#0 /opt/librenms/includes/discovery/sensors/state/linux.inc.php(30): current()
#1 /opt/librenms/includes/discovery/functions.inc.php(993): include('...')
#2 /opt/librenms/includes/discovery/sensors.inc.php(84): sensors()
#3 /opt/librenms/includes/discovery/functions.inc.php(153): include('...')
#4 /opt/librenms/discovery.php(118): discover_device()
#5 {main}
current(): Argument #1 ($array) must be of type array, null given {"exception":"[object] (TypeError(code: 0): current(): Argument #1 ($array) must be of type array, null given at /opt/librenms/includes/discovery/sensors/state/linux.inc.php:30)"}
Output of vaildate:
====================================
Component | Version
--------- | -------
LibreNMS | 22.9.0-6-g5b432ddc0
DB Schema | 2022_09_03_091314_update_ports_adsl_table_with_defaults (246)
PHP | 8.1.10
Python | 3.9.2
Database | MariaDB 10.5.15-MariaDB-0+deb11u1
RRDTool | 1.7.2
SNMP | 5.9
====================================
[OK] Composer Version: 2.4.2
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK]
[OK] Database schema correct
[OK] MySQl and PHP time match
[OK] Active pollers found
[OK] Dispatcher Service not detected
[OK] Locks are functional
[OK] Python poller wrapper is polling
[OK] Redis is unavailable
[OK] rrdtool version ok
[OK] Connected to rrdcached
Let me know if you need anymore output.
Thanks!