glpi-project / glpi-inventory-plugin

GLPI Inventory plugin
GNU Affero General Public License v3.0
46 stars 27 forks source link

softwares continue to get logged as added/deleted in the computers' historical tab #366

Closed kintaro1981 closed 1 year ago

kintaro1981 commented 1 year ago

Describe the bug

In the historical tab I can see that some software is getting logged ad deleted and installed every time the inventory runs.

from the forum: https://forum.glpi-project.org/viewtopic.php?pid=501840

To reproduce

Launch the inventory and check historical tab inside the inventoried computer page.

Expected behavior

If no new software/hardware installed or upgraded I expect no new rows, instead I can see that some software is deleted and added at every inventory:

Computer with GLPI Agent 1.4

27084956 | 2023-06-01 05:38 | inventory | Software | Delete an item: Software (Realtek Audio Control - 1.19.234.0)
27084953 | 2023-06-01 05:38 | inventory | Software | Delete an item: Software (Lenovo Companion - 10.2304.15.0)
27084950 | 2023-06-01 05:38 | inventory | Software | Delete an item: Software (Xbox Game bar - 5.823.3261.0)
27084947 | 2023-06-01 05:38 | inventory | Software | Delete an item: Software (Microsoft SQL Server 2014 Express LocalDB  - 12.3.6433.1)
27084946 | 2023-06-01 05:38 | inventory | Software | Add an item: Software (Lenovo Companion - 10.2304.15.0)
27084945 | 2023-06-01 05:38 | inventory | Software | Add an item: Software (Xbox Game Bar - 5.823.3261.0)
27084944 | 2023-06-01 05:38 | inventory | Software | Add an item: Software (Realtek Audio Control - 1.19.234.0)
27084943 | 2023-06-01 05:38 | inventory | Software | Add an item: Software (Microsoft SQL Server 2014 Express LocalDB - 12.3.6433.1)
27084942 | 2023-06-01 05:38 | inventory | Last boot date | Change 2023-05-30 15:10 to 2023-05-30 15:10
27084941 | 2023-06-01 05:38 | inventory | Last inventory date | Change 2023-05-31 17:44 to 2023-06-01 05:38
27074269 | 2023-05-31 17:44 | inventory | Software | Delete an item: Software (Realtek Audio Control - 1.19.234.0)
27074266 | 2023-05-31 17:44 | inventory | Software | Delete an item: Software (Lenovo Companion - 10.2304.15.0)
27074263 | 2023-05-31 17:44 | inventory | Software | Delete an item: Software (Xbox Game bar - 5.823.3261.0)
27074260 | 2023-05-31 17:44 | inventory | Software | Delete an item: Software (Microsoft SQL Server 2014 Express LocalDB  - 12.3.6433.1)
27074259 | 2023-05-31 17:44 | inventory | Software | Update an item: Software (Mozilla Thunderbird (x64 it) - 102.11.0 -> 102.11.2)
27074258 | 2023-05-31 17:44 | inventory | Software | Add an item: Software (Lenovo Companion - 10.2304.15.0)
27074257 | 2023-05-31 17:44 | inventory | Software | Add an item: Software (Xbox Game Bar - 5.823.3261.0)
27074256 | 2023-05-31 17:44 | inventory | Software | Add an item: Software (Realtek Audio Control - 1.19.234.0)
27074255 | 2023-05-31 17:44 | inventory | Software | Add an item: Software (Microsoft SQL Server 2014 Express LocalDB - 12.3.6433.1)
27074253 | 2023-05-31 17:44 | inventory | Last inventory date | Change 2023-05-31 09:53 to 2023-05-31 17:44
27063500 | 2023-05-31 09:53 | inventory | Software | Delete an item: Software (Realtek Audio Control - 1.19.234.0)
27063497 | 2023-05-31 09:53 | inventory | Software | Delete an item: Software (Lenovo Companion - 10.2304.15.0)
27063494 | 2023-05-31 09:53 | inventory | Software | Delete an item: Software (Xbox Game bar - 5.823.3261.0)
27063491 | 2023-05-31 09:53 | inventory | Software | Delete an item: Software (Microsoft SQL Server 2014 Express LocalDB  - 12.3.6433.1)
27063490 | 2023-05-31 09:53 | inventory | Software | Add an item: Software (Lenovo Companion - 10.2304.15.0)
27063489 | 2023-05-31 09:53 | inventory | Software | Add an item: Software (Xbox Game Bar - 5.823.3261.0)
27063488 | 2023-05-31 09:53 | inventory | Software | Add an item: Software (Realtek Audio Control - 1.19.234.0)
27063487 | 2023-05-31 09:53 | inventory | Software | Add an item: Software (Microsoft SQL Server 2014 Express LocalDB - 12.3.6433.1)
27063486 | 2023-05-31 09:53 | inventory | Last inventory date | Change 2023-05-31 09:16 to 2023-05-31 09:53

Computer with fusion inventory agent 2.5.2

27037972 | 2023-05-31 08:09 | inventory | Software | Delete an item: Software (SAMSUNG USB Driver for Mobile Phones - 1.7.56.0)
27037969 | 2023-05-31 08:09 | inventory | Software | Delete an item: Software (Adobe Connect application MSI - 21.11.22)
27037966 | 2023-05-31 08:09 | inventory | Software | Delete an item: Software (Xbox Game bar - 5.823.3261.0)
27037965 | 2023-05-31 08:09 | inventory | Software | Add an item: Software (Xbox Game Bar - 5.823.3261.0)
27037964 | 2023-05-31 08:09 | inventory | Software | Add an item: Software (Adobe Connect application MSI - 21.11.22)
27037963 | 2023-05-31 08:09 | inventory | Software | Add an item: Software (Samsung USB Driver for Mobile Phones - 1.7.56.0)
27037962 | 2023-05-31 08:09 | inventory | Last inventory date | Change 2023-05-30 11:46 to 2023-05-31 08:09
27003488 | 2023-05-30 11:46 | inventory | Software | Delete an item: Software (SAMSUNG USB Driver for Mobile Phones - 1.7.56.0)
27003485 | 2023-05-30 11:46 | inventory | Software | Delete an item: Software (Adobe Connect application MSI - 21.11.22)
27003482 | 2023-05-30 11:46 | inventory | Software | Delete an item: Software (Xbox Game bar - 5.823.3261.0)
27003481 | 2023-05-30 11:46 | inventory | Software | Update an item: Software (Intel® Graphics Command Center - 1.100.4779.0 -> 1.100.4979.0)
27003480 | 2023-05-30 11:46 | inventory | Software | Add an item: Software (Xbox Game Bar - 5.823.3261.0)
27003479 | 2023-05-30 11:46 | inventory | Software | Add an item: Software (Adobe Connect application MSI - 21.11.22)
27003478 | 2023-05-30 11:46 | inventory | Software | Add an item: Software (Samsung USB Driver for Mobile Phones - 1.7.56.0)
27003477 | 2023-05-30 11:46 | inventory | Last boot date | Change 2023-05-11 00:03 to 2023-05-11 00:03
27003476 | 2023-05-30 11:46 | inventory | Last inventory date | Change 2023-05-30 08:03 to 2023-05-30 11:46

Operating system

Windows

GLPI Agent version

1.4, Other (See additional context below)

GLPI version

10.0.7

GLPIInventory plugin

1.2.1

Additional context

GLPI Agent 1.4 and Fusion Inventory Agent 2.5.2

samww13 commented 1 year ago

Hello,

Same issue with computers deleted too (go to trash/basket) from Parc tab. Test on Glpi 10.0.7 with glpi-agent 1.4 and 1.5 (nightly build)

Operating system Linux Alma 9

GLPI Agent version 1.4, 1.5

GLPI version 10.0.7

GLPIInventory plugin 1.2.1

trasher commented 1 year ago

Please provide inventory file(s) we can use to reproduce

kintaro1981 commented 1 year ago

computer_13_13718.zip computer_0_539.zip

trasher commented 1 year ago

I'm not able to reproduce using any of provided files. The only thing present in asset history on each inventory attempt is "Last inventory date" - which is expected. Maybe is there something in your configuration or plugin that cause your isseu, try with an blank GLPI install if you reproduce.

As of "deleted computer", this is a different subject, those are certainly computers created for VMs. This specific behavior has been changed recently, try with GLPI 10.0 nightly build.

kintaro1981 commented 1 year ago

I can't try with a blank glpi install but I can try disabling all the plugins but glpi inventory.

samww13 commented 1 year ago

Thanks ! I try with fresh install during this week and give us my feedback. I dont find the inventory files that you ask me....where are there ?

trasher commented 1 year ago

I can't try with a blank glpi install but I can try disabling all the plugins but glpi inventory.

GLPI inventory does only SNMP invnetories, collect, etc; regular computer inventory is all core since GLPI 10.

trasher commented 1 year ago

Thanks ! I try with fresh install during this week and give us my feedback. I dont find the inventory files that you ask me....where are there ?

Either in computer from GLPI, or you can produce them from agent cli (see docs)

kintaro1981 commented 1 year ago

Thanks ! I try with fresh install during this week and give us my feedback. I dont find the inventory files that you ask me....where are there ?

immagine

kintaro1981 commented 1 year ago

another one from the forum: https://forum.glpi-project.org/viewtopic.php?pid=501873#p501873

mpsat commented 1 year ago

I can also confirm that we experience this behavior in our environment with latest (stable) versions of GLPI/Inventory/Agent. During each inventory run, some applications (not always the same) are marked as uninstalled and installed. Especially for the Agents we're using with the task scheduler on hourly rate, we get so many logs, so the historical tab is full of thousand and thousand entries...

image

mpsat commented 1 year ago

Here's a fresh example from today from one of our assets. As you can see in this example, three entries are constantly marked as add and deleted resulting in six lines every hourly task-based run.

2023-06-05 12_05_30-Computer

I manually executed glpi-inventory --json > c:\temp\inventory.json on that computer twice. Please find the JSON files attached.

inventory.zip

kintaro1981 commented 1 year ago

I tried disabling all the plugins (glpi inventory included) and I got as I was expecting zero rows added after the inventory. With all plugins disabled and only glpiinventory active I continue to get the same add/delete rows.

The strange thing is that it does it only with some software and not with all.

Another thing I noticed, the add/delete sowftware list is very similar from computer of the same model.

trasher commented 1 year ago

Here's a fresh example from today from one of our assets. As you can see in this example, three entries are constantly marked as add and deleted resulting in six lines every hourly task-based run.

2023-06-05 12_05_30-Computer

I manually executed glpi-inventory --json > c:\temp\inventory.json on that computer twice. Please find the JSON files attached.

inventory.zip

I can reproduce: "SOLIDWORKS eDrawings" and "SOLIDWORKS File Utilities" are removed/created at each inventory.

trasher commented 1 year ago

I tried disabling all the plugins (glpi inventory included) and I got as I was expecting zero rows added after the inventory. With all plugins disabled and only glpiinventory active I continue to get the same add/delete rows.

The strange thing is that it does it only with some software and not with all.

Another thing I noticed, the add/delete sowftware list is very similar from computer of the same model.

I do not reproduce with your files. Plugins may have impact, but also several other things (rules on software for example). That's why I was asking for a test on a "blank" GLPI.

trasher commented 1 year ago

[...] I can reproduce: "SOLIDWORKS eDrawings" and "SOLIDWORKS File Utilities" are removed/created at each inventory.

see https://github.com/glpi-project/glpi/pull/14858

mpsat commented 1 year ago

Seems the accent issue isn't the only cause. Look at that another example. Here we get eighteen rows each time (2x9 the same), without accents.

Here are two manually executed inventory reports: inventory.zip

And a screenshot image

kintaro1981 commented 1 year ago

What’s the default configuration for rules?

trasher commented 1 year ago

Seems the accent issue isn't the only cause. Look at that another example. Here we get eighteen rows each time (2x9 the same), without accents.

Here are two manually executed inventory reports: inventory.zip

I do not reproduce with those files.

stonebuzz commented 1 year ago

Seems the accent issue isn't the only cause. Look at that another example. Here we get eighteen rows each time (2x9 the same), without accents. Here are two manually executed inventory reports: inventory.zip

I do not reproduce with those files.

same for me !

trasher commented 1 year ago

Note that several issues already has been reported and fixed since 10.0.7 release. Tests I made are based on latest nightly builds (plus the patch from https://github.com/glpi-project/glpi/pull/14858).

kintaro1981 commented 1 year ago

I'm already on 10.0.7 and I don't have accents those software name string.

Is there somewhere in documentation the default configuration for rules? Anyone with a blank GLPI 10.0.7 installation can share it?

kintaro1981 commented 1 year ago

Another thing... why the software is deleted after added? The list is sorted cronologically, right?

It seams that something trigger a delete even if the inventory correctly found and added the software to the asset. If the software is found as "new" (added), why it get deleted right after?

trasher commented 1 year ago

Try with latest 10.0 nightly build, several case already have been solved.

kintaro1981 commented 1 year ago

Try with latest 10.0 nightly build, several case already have been solved.

I can’t, my colleague (sysadmin) is on vacation. I’m going to wait him and then give you feedback.

trasher commented 1 year ago

All issues shouyld be fixed in current 10.0/bugfixes nigthly builds; I close this one.

kintaro1981 commented 1 year ago

I'm on 10.0.9 now and the issue is still there but with less software, for example:

29397428 | 2023-07-20 08:50 | inventory | Software | Delete an item: Software (Microsoft SQL Server 2014 Express LocalDB  - 12.3.6433.1)
29397426 | 2023-07-20 08:50 | inventory | Software | Add an item: Software (Microsoft SQL Server 2014 Express LocalDB - 12.3.6433.1)
29397425 | 2023-07-20 08:50 | inventory | Last boot date | Change 2023-07-13 19:48 to 2023-07-13 19:48
29397424 | 2023-07-20 08:50 | inventory | Last inventory date | Change 2023-07-19 08:54 to 2023-07-20 08:50
29380589 | 2023-07-19 08:54 | inventory | Software | Delete an item: Software (Microsoft SQL Server 2014 Express LocalDB  - 12.3.6433.1)
29380587 | 2023-07-19 08:54 | inventory | Software | Add an item: Software (Microsoft SQL Server 2014 Express LocalDB - 12.3.6433.1)
29380586 | 2023-07-19 08:54 | inventory | Last boot date | Change 2023-07-13 19:48 to 2023-07-13 19:48
29380585 | 2023-07-19 08:54 | inventory | Last inventory date | Change 2023-07-18 21:50 to 2023-07-19 08:54
29371385 | 2023-07-18 21:50 | inventory | Software | Delete an item: Software (Microsoft SQL Server 2014 Express LocalDB  - 12.3.6433.1)
29371384 | 2023-07-18 21:50 | inventory | Software | Add an item: Software (Microsoft SQL Server 2014 Express LocalDB - 12.3.6433.1)

or in another computer:

23783365 | 2023-02-20 08:28 | Plugin_FusionInventory | Software | Install a software: Account aziendale o dell'\\\istituto di istruzione - 1000.19041.1023.0 (22737)
23783363 | 2023-02-20 08:28 | Plugin_FusionInventory | Software | Uninstall a software: Account aziendale o dell'\\\istituto di istruzione - 1000.19041.1023.0 (22737)
23777859 | 2023-02-19 21:09 | Plugin_FusionInventory | Software | Install a software: Account aziendale o dell'\\\istituto di istruzione - 1000.19041.1023.0 (22737)
23777855 | 2023-02-19 21:09 | Plugin_FusionInventory | Software | Uninstall a software: Account aziendale o dell'\\\istituto di istruzione - 1000.19041.1023.0 (22737)
g-bougard commented 1 year ago

Hi @kintaro1981 can you extract from inventories the related entries ? Don't forget to check if there's more than one entry with the same name & version.