I have a DC rectifier from, alpha that returns
rectSysEstimatedBatteryRuntime.0 = 16078
this is 16 hours 07 min and 8 seconds
I was using
user_func: '\LibreNMS\OS\BaicellsOd04::hhmmss_to_minutes'
but that changed in a previous update now I am using
runtime:
data:
-
oid: rectifierSystem
num_oid: '.1.3.6.1.4.1.7309.5.3.1.31.{{ $index }}'
value: rectSysEstimatedBatteryRuntime
descr: 'Estimated Run Time in hours'
index: rectSysEstimatedBatteryRuntime.{{ $index }}
user_func: hhmmssToMinutes
and during discovery I get an error
Sensor fetched value: 16078
Error discovering sensors module for alpha ErrorException: Undefined array key 1 in /opt/librenms/LibreNMS/Util/UserFuncHelper.php:57
Stack trace:
#0 /opt/librenms/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(256): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError()
#1 /opt/librenms/LibreNMS/Util/UserFuncHelper.php(57): Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}()
#2 /opt/librenms/includes/discovery/functions.inc.php(644): LibreNMS\Util\UserFuncHelper->hhmmssToMinutes()
#3 /opt/librenms/includes/discovery/functions.inc.php(687): discovery_process()
#4 /opt/librenms/includes/discovery/sensors.inc.php(50): sensors()
#5 /opt/librenms/includes/discovery/functions.inc.php(173): include('...')
#6 /opt/librenms/discovery.php(108): discover_device()
#7 {main}
this was working when I used to point my user function to
user_func: '\LibreNMS\OS\BaicellsOd04::hhmmss_to_minutes'
but that was removed and replaced with hhmmssToMinutes
I even tried to give it a multiplier of 10 to make it 6 digits and I am still getting the same error.