You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2012-10-17 12:03:44

albertus
Member
Registered: 2012-02-12
Posts: 20

Table glpi_logs is huge

Hi,

After a look to the BD, I see that the glpi_logs table keeps growing over time, there isn't any king of cleaning. I've tried the cleanhistory.php, which cleans the table, but it grows again. I've enabled and executed the 'logs' task but it doesn't make any difference. Is there any setting to limit the maximum age of entries in glpi_logs, or disable logging?

Offline

#2 2012-10-17 18:15:03

remi
GLPI-DEV
From: Champagne
Registered: 2007-04-28
Posts: 7,127
Website

Re: Table glpi_logs is huge

Yes this table is huge, by design.

But having millions of entry should not be an issue.


Dév. Fedora 29 - PHP 5.6/7.0/7.1/7.2/7.3/7.4 - MariaDB 10.3 - GLPI master
Certifié ITILv3 - RPM pour Fedora, RHEL et CentOS sur https://blog.remirepo.net/

Offline

#3 2012-10-17 23:19:56

albertus
Member
Registered: 2012-02-12
Posts: 20

Re: Table glpi_logs is huge

It is an issue to me, as the DB size is above 1GB, and the backups take a long time to complete. Furthermore, it requires manual mainteinance from time to time (to clean the table). Another problem is the long time that a db optimization takes.

I think that a new task to rotate these entries would be the finest solution here.

Last edited by albertus (2012-10-17 23:20:52)

Offline

#4 2012-10-24 22:16:41

emilio
Member
From: Portugal
Registered: 2008-07-02
Posts: 13

Re: Table glpi_logs is huge

In my case I think the problem is the plugin FusioninventoryAgent, it create a new record whit the same info (old_value = new_value)

Offline

#5 2012-10-24 22:39:39

ddurieux
Plugins Dev
From: Propières, France
Registered: 2005-06-17
Posts: 7,521

Re: Table glpi_logs is huge

Can you copy one of these lines?

Version of GLPI?

Version of plugins FusionInventory?

Offline

#6 2012-10-25 13:00:17

emilio
Member
From: Portugal
Registered: 2008-07-02
Posts: 13

Re: Table glpi_logs is huge

GLPI version = 0.80.7
FusionInventory plugins =     0.80+1.1

exemple of lines:
old_value = {"INVENTORY":"v2.1.8-1"}     new_value     = {"INVENTORY":"v2.1.8-1"}
old_value = {"INVENTORY":"v2.1.9-2"}     new_value     = {"INVENTORY":"v2.1.9-2"}
old_value = {"INVENTORY":"v2.1.9-3"}   new_value     = {"INVENTORY":"v2.1.9-3"}
old_value = {"INVENTORY":"v2.1.11-1"} new_value     = {"INVENTORY":"v2.1.11-1"}

Offline

#7 2012-10-25 13:14:06

ddurieux
Plugins Dev
From: Propières, France
Registered: 2005-06-17
Posts: 7,521

Re: Table glpi_logs is huge

It has been fixed (moe than 6 months ago) in the fixes version 0.80+1.3 of plugins fusioninventory

Offline

#8 2012-10-25 14:07:44

albertus
Member
Registered: 2012-02-12
Posts: 20

Re: Table glpi_logs is huge

I don't use fusioninventory. In my case, almost all rows come from user_name=massocsimport or cron_ocsng (a mix from both)

Offline

#9 2012-10-25 17:09:24

emilio
Member
From: Portugal
Registered: 2008-07-02
Posts: 13

Re: Table glpi_logs is huge

I have to upgrade to a newer version of the plugin.

Can you help to clean the database, its there a SQL sintax that I can use?

many thanks for you help ddurieux

Offline

#10 2012-10-26 20:35:23

emilio
Member
From: Portugal
Registered: 2008-07-02
Posts: 13

Re: Table glpi_logs is huge

What do you think about this syntax for clear database ?

SELECT * FROM `glpi`.`glpi_logs` where user_name = 'Plugin_FusionInventory'
and old_value = new_value and linked_action = '0';

Offline

#11 2012-10-28 15:51:17

emilio
Member
From: Portugal
Registered: 2008-07-02
Posts: 13

Re: Table glpi_logs is huge

<RemiFedora> help with this: "there is a script to clean the glpi_logs"
https://forge.indepnet.net/projects/glp … istory.php
so i try and do : "php cleanhistory.php --type=12 --delay=0" it only return 306 entries

but if I use
SELECT count(user_name) as Plugin_FusionInventory from glpi_logs
where old_value = new_value and linked_action = "0";

it return 173062 entries, what do you think?

Offline

Board footer

Powered by FluxBB