Error during SNMP discovery

SNMP discoveries on printers are throwing an error. I haven’t made any changes… it started to occur over the Easter weekend.

Here is the error in the discovery log

Fatal error: Uncaught Error: Cannot use string offset as an array in /opt/librenms/includes/snmp.inc.php:461
Stack trace:
#0 /opt/librenms/includes/discovery/toner.inc.php(8): snmpwalk_cache_oid(Array, ‘prtMarkerSuppli…’, ‘2.0.0.0.0.0.0.0…’, ‘Printer-MIB’)
#1 /opt/librenms/includes/discovery/functions.inc.php(183): include(’/opt/librenms/i…’)
#2 /opt/librenms/discovery.php(128): discover_device(Array, Array)
#3 {main}
thrown in /opt/librenms/includes/snmp.inc.php on line 461

What version of php?

PHP 7.0.28-0ubuntu0.16.04.1 (cli) ( NTS )

pastebin the output of ./discovery.php -h HOSTNAME -d -m toner

https://pastebin.com/JRKcDHh1

here is another paste of the full discovery
https://pastebin.com/NED3ZZVi

seeing this on php 5.6 too

Please try this patch: https://p.libren.ms/view/raw/487442c6

That fixed it.

I’ve submitted a pull request to fix this so just remove the patch and let updates fix it.