glpi-project / glpi-agent

GLPI Agent
GNU General Public License v2.0
212 stars 51 forks source link

Storing OS as a Software problem #676

Closed ExPx77 closed 1 month ago

ExPx77 commented 1 month ago

Code of Conduct

Is there an existing issue for this?

Version

10.0.15

Bug description

I found a problem with storing OS as a software feature. GLPI Agent uses last_state.json to track changes. When no change on OS and some change on software inventory causes OS software record deletion (installations tab). Because JSON won't have a OS node. Thanks.

Relevant log output

No response

Page URL

No response

Steps To reproduce

  1. Fresh install GLPI Agent on a computer.
  2. Force inventory.
  3. Check operating system on Software tab on computer record.
  4. Install or uninstall a software on computer.
  5. Force inventory again.

Your GLPI setup information

GLPI Agent 1.8

Anything else?

No response

trasher commented 1 month ago

If there is no "OS" in json file, this is an agent issue, ot a GLPI one.

g-bougard commented 1 month ago

Hi @trasher

on agent-side, this is probably a side-effect of the new feature full-inventory-postpone. With this feature, only changed category will be submitted in a partial inventory until the time is to run a full inventory.

To me, on server-side, we should not remove OS if a partial inventory is submitted and OS is not set in inventory.

@ExPx77 you can disable this feature setting new parameter full-inventory-postpone to 0. Then restart the service and tell us if this fixes your issue.

ExPx77 commented 1 month ago

Hi @g-bougard

I have disabled full-inventory-postpone parameter and tested on my computer. On every inventory request agent built full inventory json file. (checked on server side). OS software record appended again and not deleted on subsequent tests.

I have deployed agents to hundreds of computers. Applying this fix all of it is not easy.

g-bougard commented 1 month ago

Hi @ExPx77

after a discussion with GLPI team, we decided to fix the problem on GLPI-Agent side.

Next nightly build should work as expected even with full-inventory-postpone feature enabled as it is by default.