fusioninventory / fusioninventory-for-glpi

FusionInventory plugin for GLPI
http://www.FusionInventory.org/
GNU Affero General Public License v3.0
361 stars 148 forks source link

GLPI 9.3.2/FI 9.3+1.0: WebUI "Tasks - Monitoring/Logs" empty / No data in "glpi_plugin_fusioninventory_taskjoblogs" #2709

Open GitStorm opened 5 years ago

GitStorm commented 5 years ago

In reference to #2600

GLPI 9.3.2 / FusionInventory 9.3+1.0. CentOS Linux release 7.5.1804 (Core) MariaDB Server 10.3.10-MariaDB Apache/2.4.6 (CentOS) PHP 7.2.6

No data in glpi_plugin_fusioninventory_taskjoblogs:

MariaDB [glpi]> SELECT * FROM glpi_plugin_fusioninventory_taskjoblogs;
Empty set (0.000 sec)

/var/www/glpi/files/_log/sql_errors.log does not exist /var/www/glpi/files/_log/php_errors.log has no relevant errors/warnings according to @ddurieux

taskscheduler is running:

MariaDB [glpi]> SELECT * FROM glpi_crontasks WHERE glpi_crontasks.id = '33' LIMIT 1;
+----+---------------------------+---------------+-----------+-------+-------+------+-----------+---------+---------+---------------+---------------------+----------+---------+---------------------+---------------------+
| id | itemtype | name | frequency | param | state | mode | allowmode | hourmin | hourmax | logs_lifetime | lastrun | lastcode | comment | date_mod | date_creation |
+----+---------------------------+---------------+-----------+-------+-------+------+-----------+---------+---------+---------------+---------------------+----------+---------+---------------------+---------------------+
| 33 | PluginFusioninventoryTask | taskscheduler | 300 | NULL | 1 | 2 | 3 | 0 | 24 | 30 | 2018-11-02 11:23:00 | NULL | NULL | 2018-11-02 10:03:02 | 2018-06-05 16:59:21 |
+----+---------------------------+---------------+-----------+-------+-------+------+-----------+---------+---------+---------------+---------------------+----------+---------+---------------------+---------------------+
1 row in set (0.000 sec)

SHOW CREATE TABLE glpi_plugin_fusioninventory_taskjoblogs;

MariaDB [glpi]> SHOW CREATE TABLE glpi_plugin_fusioninventory_taskjoblogs;
+-----------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-----------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| glpi_plugin_fusioninventory_taskjoblogs | CREATE TABLE glpi_plugin_fusioninventory_taskjoblogs (
id bigint(20) NOT NULL AUTO_INCREMENT,
plugin_fusioninventory_taskjobstates_id int(11) NOT NULL DEFAULT 0,
date datetime DEFAULT NULL,
items_id int(11) NOT NULL DEFAULT 0,
itemtype varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
state int(11) NOT NULL DEFAULT 0,
comment text COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (id),
KEY plugin_fusioninventory_taskjobstates_id (plugin_fusioninventory_taskjobstates_id,state)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci |
+-----------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.000 sec)
Badrie commented 3 years ago

Hello hello,

I do have the same issue (no data in "glpi_plugin_fusioninventory_taskjoblogs") but with some differences.

GLPI 9.5.5 / FusionInventory 9.5+3.0 Debian release 9.13 Server version: 10.1.26-MariaDB-0+deb9u1 Debian 9.1 Server version: Apache/2.4.25 (Debian) PHP 7.4.13

No data in glpi_plugin_fusioninventory_taskjoblogs:

MariaDB [glpidb]> SELECT * FROM glpi_plugin_fusioninventory_taskjoblogs;
Empty set (0.00 sec)

/var/www/glpi-9.5.5/files/_log/sql-errors.log does exist and this error is repeated three times a day and every day:

cat /var/www/glpi-9.5.5/files/_log/sql-errors.log | grep log |tail -n 5
[2021-08-18 18:20:26] glpisqllog.ERROR: DBmysql::query() in /var/www/glpi-9.5.5/inc/dbmysql.class.php line 309
[2021-08-19 07:29:43] glpisqllog.ERROR: DBmysql::query() in /var/www/glpi-9.5.5/inc/dbmysql.class.php line 309
[2021-08-19 09:52:15] glpisqllog.ERROR: DBmysql::query() in /var/www/glpi-9.5.5/inc/dbmysql.class.php line 309
[2021-08-20 01:21:39] glpisqllog.ERROR: DBmysql::query() in /var/www/glpi-9.5.5/inc/dbmysql.class.php line 309
[2021-08-20 07:32:03] glpisqllog.ERROR: DBmysql::query() in /var/www/glpi-9.5.5/inc/dbmysql.class.php line 309

I do suppose the taskscheduler is running with that ? :

SELECT * FROM glpi_crontasks WHERE glpi_crontasks.id = '33' LIMIT 1;
+----+------------+--------------+-----------+-------+-------+------+-----------+---------+---------+---------------+---------+----------+---------+----------+---------------+
| id | itemtype   | name         | frequency | param | state | mode | allowmode | hourmin | hourmax | logs_lifetime | lastrun | lastcode | comment | date_mod | date_creation |
+----+------------+--------------+-----------+-------+-------+------+-----------+---------+---------+---------------+---------+----------+---------+----------+---------------+
| 33 | ObjectLock | unlockobject |     86400 |     4 |     0 |    1 |         3 |       0 |      24 |            30 | NULL    |     NULL | NULL    | NULL     | NULL          |
+----+------------+--------------+-----------+-------+-------+------+-----------+---------+---------+---------------+---------+----------+---------+----------+---------------+
1 row in set (0.00 sec)

SHOW CREATE TABLE glpi_plugin_fusioninventory_taskjoblogs;

`SHOW CREATE TABLE glpi_plugin_fusioninventory_taskjoblogs;`
+-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table                                   | Create Table                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
+-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| glpi_plugin_fusioninventory_taskjoblogs | CREATE TABLE `glpi_plugin_fusioninventory_taskjoblogs` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `plugin_fusioninventory_taskjobstates_id` int(11) NOT NULL DEFAULT '0',
  `date` timestamp NULL DEFAULT NULL,
  `items_id` int(11) NOT NULL DEFAULT '0',
  `itemtype` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `state` int(11) NOT NULL DEFAULT '0',
  `comment` text COLLATE utf8_unicode_ci,
  PRIMARY KEY (`id`),
  KEY `plugin_fusioninventory_taskjobstates_id` (`plugin_fusioninventory_taskjobstates_id`,`state`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci |
+-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

` I hope there will be answers or at least comments to help us. In waiting for your comments, have a nice day

ddurieux commented 3 years ago

Can you send the result of

SELECT * FROM glpi_crontasks WHERE name="taskscheduler";
Badrie commented 3 years ago

The result of this command is :

SELECT * FROM glpi_crontasks WHERE name="taskscheduler";
+----+---------------------------+---------------+-----------+-------+-------+------+-----------+---------+---------+---------------+---------------------+----------+---------+---------------------+---------------------+
| id | itemtype                  | name          | frequency | param | state | mode | allowmode | hourmin | hourmax | logs_lifetime | lastrun             | lastcode | comment | date_mod            | date_creation       |
+----+---------------------------+---------------+-----------+-------+-------+------+-----------+---------+---------+---------------+---------------------+----------+---------+---------------------+---------------------+
| 64 | PluginFusioninventoryTask | taskscheduler |        60 |  NULL |     1 |    2 |         3 |       0 |      24 |            30 | 2021-08-20 10:20:00 |     NULL | NULL    | 2021-04-29 10:23:43 | 2021-04-29 10:23:43 |
+----+---------------------------+---------------+-----------+-------+-------+------+-----------+---------+---------+---------------+---------------------+----------+---------+---------------------+---------------------+
1 row in set (0.00 sec)
ddurieux commented 3 years ago

Ok, so the crontab (run by your operating system) will start the fusion task and fill the glpi_plugin_fusioninventory_taskjoblogs table.

Badrie commented 3 years ago

Does that mean i need to install and configure crontab to start the taskjoblogs?

ddurieux commented 3 years ago

Yes, see http://fusioninventory.org/documentation/fi4g/cron.html

Badrie commented 3 years ago

Thank you for your answers i'll try to do that.

Badrie commented 3 years ago

Yes, see http://fusioninventory.org/documentation/fi4g/cron.html

Hello i'm back,

i did the thing to make the tasksheduler run every minutes in cron and as you can see it does run but the table glpi_plugin_fusioninventory_taskjoblogs is empty. Tasksheduler

Is it possible the task which fill the table is not working properly ?