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

Window OS Version not Updating - GLPI 9.3.1 Agent 2.4 #2714

Open letsridehawk65 opened 5 years ago

letsridehawk65 commented 5 years ago

My windows pc OS is not updating after a computer is upgraded.

Process:

Update a Windows PC OS (Windows 7 to Windows 10) and run inventory update (Fusion Inventory Agent). The listed OS Name and version doesn't update in GLPI. Check the OS information from the "Download inventory file" and it lists the correct OS information.

GLPI 9.3.1 Fusion Agent 2.4

glpibr commented 5 years ago

@letsridehawk65 if you change the System like Windows to Linux is the same problem

letsridehawk65 commented 5 years ago

@glpibr I do not have any Linux systems.

glpibr commented 5 years ago

@letsridehawk65 sorry. it was a confirmation for dev analyse.

letsridehawk65 commented 5 years ago

@glpibr I am not sure I understand what you want me to do.

ddurieux commented 5 years ago

So the old is yet here and the new OS not filled? (in operating system tab?)

letsridehawk65 commented 5 years ago

@ddurieux Under operating system it lists the old OS. If I click "Import Information" -> "Download inventory file" the OS listed in the xml file is correct.

ddurieux commented 5 years ago

Ok, thanks for the details we see where is the problem, we will try fix it quickly

letsridehawk65 commented 5 years ago

@ddurieux Any update on the resolution to the issue?

darkno90 commented 5 years ago

Hello, I got exactly the same problem, when i update my windows, in inventory there is no modification I use glpi 9.3.0 and Fusion Inventory 9.3+1.1 and agent 2.4.2

Ph1eG commented 5 years ago

Same problem here with FI-P9.2+2.0 + FI-A 2.4.

Ph1eG commented 5 years ago

Hello ! Any update or news about the resolution of this issue ? Thanks !

ddurieux commented 5 years ago

Not yet, I think soon ;)

Ph1eG commented 5 years ago

Hi David ! Is FI agent 2.4.3 resolving this issue now ? Thanks !

Ph1eG commented 5 years ago

or maybe a fix plugin side is needed ? Thx

zepolam commented 5 years ago

Hello ! Any update or news about the resolution of this issue? We have the sambe problem with GLPI 9.3.1 & FI Agent 2.4.3 (server side 9.3+1.1) Thanks !

Lupick commented 4 years ago

We have the same issue..... GLPI 9.4.4; FI 9.4+1.1

ramanlavan commented 4 years ago

We have the same issue.... GLPI 9.4.3; FI 9.4+1.1

Ph1eG commented 4 years ago

We're still waiting for a fix for a year now :) The bug seems to be present in both old and new versions.

ddurieux commented 4 years ago

Sorry for the delay, not simple to reproduce :(

Ph1eG commented 4 years ago

ok, no prb. Previously, you seemed to say that you had found where the problem is and that you were going to release a fix. We were waiting for it. If we can help you to reproduce, ask us! Anyway thanks for the time spent.

ddurieux commented 4 years ago

Is it possible to send me the XML + dump GLPI database, or perhaps a teamviewer to your test env for example

Lupick commented 4 years ago

I've a similar issue ; in my case the affected computer under OS they have 2 record:

  1. Windows 7 64-bit Service Pack 1
  2. Microsoft Windows 7 Professional 64-bit Service Pack 1

the operating system Item count is 2!

If I delete the two records (or only the second one) and force inventory I'm able to fix the problem for that computer.

There is a way to do it on all my entity?

Thany you for your work!!

trasher commented 4 years ago

Your problem (2 os instead of 1) does not seems related to the initial issue. To drop those dups, I had once provided the following query that seems to solve the issue (be carefull, I've not tested):

DELETE FROM glpi_items_operatingsystems
WHERE items_id IN (SELECT * FROM(SELECT items_id FROM glpi_items_operatingsystems as ios group by items_id having count(items_id) > 1) as ios2)
AND operatingsystemarchitectures_id = 0
Lupick commented 4 years ago
DELETE FROM glpi_items_operatingsystems
WHERE items_id IN (SELECT * FROM(SELECT items_id FROM glpi_items_operatingsystems as ios group by items_id having count(items_id) > 1) as ios2)
AND operatingsystemarchitectures_id = 0

It doesn't look to solve the issue; It delete 1 os only on Items with 3 os. I'll try to fix mannually

ddurieux commented 4 years ago

I'm not have this problem, I tested with many xml for the same computer with different operating system.

@Ph1eG I need help to reproduce

Ph1eG commented 4 years ago

@ddurieux ok how can i contact you ? (je suis français ;)) i have xml file and a teamviewer access to the test env. Let me know how and when we can do that. Thx

ddurieux commented 4 years ago

Mon mail: david@durieux.family Je suis disponible à 16h00 cet après midi

abmteam commented 4 years ago

Hi all, I'm using FusionInventory Agent (2.5.1-1).

Here I dont have issue when using GLPI 9.4.4 and FusionInventory 9.4+2.1.

But issue occcurs when using: GLPI 9.2.2 and FusionInventory 9.1+1.0

If I comment the line $this->input = $this->prepareInputForUpdate($this->input); in the file inc/commondbtm.class.php, THIS issue doesn't occurr. Maybe it can have side effects!

    function update(array $input, $history = 1, $options = []) {
      global $DB, $CFG_GLPI;

      if ($DB->isSlave()) {
         return false;
      }

      if (!$this->getFromDB($input[static::getIndexName()])) {
         return false;
      }

      // Store input in the object to be available in all sub-method / hook
      $this->input = $input;

      // Manage the _no_history
      if (!isset($this->input['_no_history'])) {
         $this->input['_no_history'] = !$history;
      }

      // Plugin hook - $this->input can be altered
      Plugin::doHook("pre_item_update", $this);
      if ($this->input && is_array($this->input)) {
        $this->input = $this->prepareInputForUpdate($this->input);   <----- COMMENT THIS LINE
         if (isset($this->input['update'])) {
            $this->input['_update'] = $this->input['update'];
            unset($this->input['update']);
         }
         $this->filterValues(!isCommandLine());
      }
trasher commented 4 years ago

If I comment the line $this->input = $this->prepareInputForUpdate($this->input); in the file inc/commondbtm.class.php, THIS issue doesn't occurr. Maybe it can have side effects!

It does have side effect; this is really not a good idea.

abmteam commented 4 years ago

Ok. Thank you.

-- Just for record, before this line, $this->input value is

Array ( [id] => 8316 [itemtype] => Computer [items_id] => 17650 [operatingsystemarchitectures_id] => 2 [operatingsystemkernelversions_id] => 211 [operatingsystems_id] => 103 [operatingsystemversions_id] => 149 [operatingsystemservicepacks_id] => 0 [operatingsystemeditions_id] => 0 [license_id] => [license_number] => [is_dynamic] => 1 [entities_id] => 1 [_no_history] => )

After this line is .

abmteam commented 4 years ago

Hi, another try :)

File inc/commondbrelation.class.php. Function canRelationItem.

If I change this

     if ((!$can1 && !$can2)
          || ($can1 && !$view2)
          || ($can2 && !$view1)) {

for this

      if ((!$can1 && !$can2)
          || ($can1 && !$view1)
          || ($can2 && !$view2)) {

the issue disappears. Maybe it can have side effects! :)

abmteam commented 4 years ago

Hi, another try :)

File inc/commondbrelation.class.php. Function canRelationItem.

If I change this

     if ((!$can1 && !$can2)
          || ($can1 && !$view2)
          || ($can2 && !$view1)) {

for this

      if ((!$can1 && !$can2)
          || ($can1 && !$view1)
          || ($can2 && !$view2)) {

the issue disappears. Maybe it can have side effects! :)

Up to now, it seems to work. Has anyone tested it?

ddurieux commented 4 years ago

If you don't have issue with GLPI 9.4, use it. The support of GLPI 9.2 is over

spinaldf commented 4 years ago

Hi, another try :) File inc/commondbrelation.class.php. Function canRelationItem. If I change this

     if ((!$can1 && !$can2)
          || ($can1 && !$view2)
          || ($can2 && !$view1)) {

for this

      if ((!$can1 && !$can2)
          || ($can1 && !$view1)
          || ($can2 && !$view2)) {

the issue disappears. Maybe it can have side effects! :)

Up to now, it seems to work. Has anyone tested it?

Hi, I have 9.2 Glpi Version and now I test and its working.