Closed Falco68 closed 6 years ago
I found the mistake in the cron, the itemtype should be Printer and not Printer. You have to correct the installation documentation, in chapter 1.3, the example show Printer.
Okay thank you for your return, I've modified the documentation.
Hello,
I just installed the plugin on my test environment. PrinterCounters 1.4.0 GLPI 9.2.1 Apache 2.4.18 PHP 7.0.25 MySQL 5.7.21 Ubuntu 16.04 I created two record models with five printers linked. In the printer record when I run an immediate check, counter value is retrieved well. But with the cron task no value is retrieved. The cron line is 10 23 www-data /usr/bin/php /var/www/glpi/plugins/printercounters/scripts/run.php --sonprocess_nbr=4 --itemtype=Printer
In GLPI logs I got, printercounters_fullsync.log Mon, 26 Feb 2018 23:10:01 +0100 /var/www/glpi/plugins/printercounters/scripts/run.php started 7878 Started 7880 Started 7884 Started 7886 Started Aucune imprimante à interroger 7880 ended, waiting for 3 running son process Aucune imprimante à interroger 7878 ended, waiting for 2 running son process Aucune imprimante à interroger Aucune imprimante à interroger 7884 ended, waiting for 1 running son process 7886 ended, waiting for 0 running son process Mon, 26 Feb 2018 23:10:02 +0100 /var/www/glpi/plugins/printercounters/scripts/run.php ended
And in php-errors.log 2018-02-26 23:10:02 [@syslxglpitest] *** PHP Notice(8): Trying to get property of non-object Backtrace : inc/dbmysql.class.php:277
plugins/printercounters/inc/process.class.php:270 DBmysql->numrows() plugins/printercounters/inc/process.class.php:163 PluginPrintercountersProcess->selectPrinterToSearch() plugins/printercounters/inc/record.class.php:657 PluginPrintercountersProcess->getIPAddressesForProcess() ...ounters/scripts/printercounters_fullsync.php:82 PluginPrintercountersRecord->initRecord()
Should be a misspelling in the itemtype parameter? What do you think?