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

MMODEL not present on Windows 2003 Server #552

Closed ddurieux closed 8 years ago

ddurieux commented 8 years ago

Author Name: DuyLong LE (DuyLong LE) Original Redmine Issue: 1064, http://forge.fusioninventory.org/issues/1064 Original Date: 2011-08-11 Original Assignee: Gonéri Le Bouder


It's OK on Windows 2008...

    <BIOS>
      <ASSETTAG>                                </ASSETTAG>
      <BASEBOARDSERIAL/>
      <BDATE>01/24/2008</BDATE>
      <BIOSSERIAL>CZC8112FGR      </BIOSSERIAL>
      <BMANUFACTURER>HP</BMANUFACTURER>
      <BVERSION>P56</BVERSION>
      <ENCLOSURESERIAL>CZC8112FGR      </ENCLOSURESERIAL>
      <MMANUFACTURER/>
      <MMODEL>ProLiant DL380 G5</MMODEL>
      <MSN/>
      <SMANUFACTURER>HP</SMANUFACTURER>
      <SMODEL/>
      <SSN>CZC8112FGR</SSN>
      <TYPE>Rack Mount Chassis</TYPE>
    </BIOS>
ddurieux commented 8 years ago

Original Redmine Comment Author Name: Gonéri Le Bouder (Gonéri Le Bouder) Original Date: 2011-08-11T09:44:57Z


Can you please check the mmodel information is avalaible in the dmidecode.exe outpout for this machine. In 99% of the cases, that's the reason why an information is missing in .

ddurieux commented 8 years ago

Original Redmine Comment Author Name: DuyLong LE (DuyLong LE) Original Date: 2011-08-11T12:31:38Z


It's not a problem of agent, because the xml file is correct (see the bios tag) and it has the informations.

ddurieux commented 8 years ago

Original Redmine Comment Author Name: DuyLong LE (DuyLong LE) Original Date: 2011-08-11T18:38:47Z


I must download dmidecode.exe ?

I don't understand why the value MMODEL is not in SMODEL (this value match with the model value in glpi). Moreover SMANUFACTURER is check and should match with the value in MMODEL field.

It's strange...

ddurieux commented 8 years ago

Original Redmine Comment Author Name: Gonéri Le Bouder (Gonéri Le Bouder) Original Date: 2011-08-12T10:07:41Z


Can you please try this patch:

diff --git a/lib/FusionInventory/Agent/Task/Inventory/OS/Win32/Bios.pm b/lib/FusionInventory/Agent/Task/Inventory/OS/Win32/Bios.pm
index 80511c8..3589cb7 100644
--- a/lib/FusionInventory/Agent/Task/Inventory/OS/Win32/Bios.pm
+++ b/lib/FusionInventory/Agent/Task/Inventory/OS/Win32/Bios.pm
@@ -84,7 +84,7 @@ sub doInventory {
         Manufacturer Model
     /)) {
         $smanufacturer = $Properties->{Manufacturer} unless $smanufacturer;
-        $model = $Properties->{Model} unless $model;
+        $smodel = $Properties->{Model} unless $smodel;
     }

     foreach my $Properties (getWmiProperties('Win32_SystemEnclosure', qw/
@@ -100,13 +100,13 @@ sub doInventory {
     /)) {
         $baseBoardSerial = $Properties->{SerialNumber};
         $ssn = $Properties->{SerialNumber} unless $ssn;
-        $smodel = $Properties->{Product} unless $smodel;
+        $model = $Properties->{Product} unless $model;
         $smanufacturer = $Properties->{Manufacturer} unless $smanufacturer;

     }

     $inventory->setBios({
-        SMODEL => $smodel,
+        SMODEL => $model,
         SMANUFACTURER =>  $smanufacturer,
         SSN => $ssn,
         BDATE => $bdate,
@@ -114,7 +114,7 @@ sub doInventory {
         BMANUFACTURER => $bmanufacturer,
         MMANUFACTURER => $mmanufacturer,
         MSN => $msn,
-        MMODEL => $model,
+        MMODEL => $smodel,
         ASSETTAG => $assettag,
         ENCLOSURESERIAL => $enclosureSerial,
         BASEBOARDSERIAL => $baseBoardSerial,
@@ -124,11 +124,11 @@ sub doInventory {
     my $vmsystem;
 # it's more reliable to do a regex on the CPU NAME
 # QEMU Virtual CPU version 0.12.4
-#    if ($bmanufacturer eq 'Bochs' || $model eq 'Bochs') {
+#    if ($bmanufacturer eq 'Bochs' || $smodel eq 'Bochs') {
 #        $vmsystem = 'QEMU';
 #    } els

-    if ($bversion eq 'VirtualBox' || $model eq 'VirtualBox') {
+    if ($bversion eq 'VirtualBox' || $smodel eq 'VirtualBox') {
         $vmsystem = 'VirtualBox';
     }
ddurieux commented 8 years ago

Original Redmine Comment Author Name: DuyLong LE (DuyLong LE) Original Date: 2011-08-12T14:35:29Z


Output of dmidecode.exe command.

ddurieux commented 8 years ago

Original Redmine Comment Author Name: Gonéri Le Bouder (Gonéri Le Bouder) Original Date: 2011-08-12T14:48:41Z


I don't understand why MMODEL is not set by Windows in the first case.

I get MMODEL from the WMI Win32_ComputerSystem.Model: → Product name that a manufacturer gives to a computer. This property must have a value.

I think this is correct.

ddurieux commented 8 years ago

Original Redmine Comment Author Name: Gonéri Le Bouder (Gonéri Le Bouder) Original Date: 2011-08-12T15:04:37Z


This patch on the server fix the issue:

diff --git a/inc/libhook.class.php b/inc/libhook.class.php
index 43ec37b..0289fdd 100644
--- a/inc/libhook.class.php
+++ b/inc/libhook.class.php
@@ -167,7 +167,7 @@ class PluginFusinvinventoryLibhook {

                   }
                }
-               if (isset($dataSection['SMODEL'])) {
+               if (isset($dataSection['SMODEL']) AND (!empty($dataSection['SMODEL']))) {
                   if (!in_array('computermodels_id', $a_lockable)) {
                      $ComputerModel = new ComputerModel();
                      $inputC['computermodels_id'] = $ComputerModel->importExternal($dataSection['SMODEL']);
@@ -1098,4 +1098,4 @@ class PluginFusinvinventoryLibhook {
     }
 }
ddurieux commented 8 years ago

Original Redmine Comment Author Name: Gonéri Le Bouder (Gonéri Le Bouder) Original Date: 2011-08-12T15:05:21Z


I reaffect the bug to the FusionInventory for GLPI.

ddurieux commented 8 years ago

Original Redmine Comment Author Name: DuyLong LE (DuyLong LE) Original Date: 2011-08-12T17:46:15Z


Ticket #1043 don't resolve my problem.

A other computer on Windows Server 2003 Enterprise :

    <BIOS>
      <ASSETTAG>                                </ASSETTAG>
      <BASEBOARDSERIAL/>
      <BDATE>10/04/2007</BDATE>
      <BIOSSERIAL>CZC7543PCH      </BIOSSERIAL>
      <BMANUFACTURER>HP</BMANUFACTURER>
      <BVERSION>P56</BVERSION>
      <ENCLOSURESERIAL>CZC7543PCH      </ENCLOSURESERIAL>
      <MMANUFACTURER/>
      <MMODEL>ProLiant DL380 G5</MMODEL>
      <MSN/>
      <SMANUFACTURER>HP</SMANUFACTURER>
      <SMODEL/>
      <SSN>CZC7543PCH</SSN>
      <TYPE>Rack Mount Chassis</TYPE>
    </BIOS>

The problem seems present only HP servers.

Here is a Dell server on Windows Server 2003 Standard :

    <BIOS>
      <ASSETTAG/>
      <BASEBOARDSERIAL>..CN7081169U006S.</BASEBOARDSERIAL>
      <BDATE>06/21/2006</BDATE>
      <BIOSSERIAL>FS6SK2J</BIOSSERIAL>
      <BMANUFACTURER>Dell Inc.</BMANUFACTURER>
      <BVERSION>1.1.0</BVERSION>
      <ENCLOSURESERIAL>FS6SK2J</ENCLOSURESERIAL>
      <MMANUFACTURER/>
      <MMODEL>PowerEdge 2950</MMODEL>
      <MSN/>
      <SMANUFACTURER>Dell Inc.</SMANUFACTURER>
      <SMODEL>0PR268</SMODEL>
      <SSN>FS6SK2J</SSN>
      <TYPE>Rack Mount Chassis</TYPE>
    </BIOS>

I don't know why, but one HP server only succeed :

    <BIOS>
      <ASSETTAG>                                </ASSETTAG>
      <BASEBOARDSERIAL/>
      <BDATE/>
      <BIOSSERIAL>                </BIOSSERIAL>
      <BMANUFACTURER>HP</BMANUFACTURER>
      <BVERSION>P51</BVERSION>
      <ENCLOSURESERIAL>                </ENCLOSURESERIAL>
      <MMANUFACTURER/>
      <MMODEL>ProLiant DL380 G4</MMODEL>
      <MSN/>
      <SMANUFACTURER>HP</SMANUFACTURER>
      <SMODEL/>
      <SSN></SSN>
      <TYPE>Rack Mount Chassis</TYPE>
    </BIOS>
ddurieux commented 8 years ago

Original Redmine Comment Author Name: David Durieux (@ddurieux) Original Date: 2011-08-15T16:20:55Z


Is this works on version 2.4.0-RC2 of plufins fusioninventory ?

ddurieux commented 8 years ago

Original Redmine Comment Author Name: DuyLong LE (DuyLong LE) Original Date: 2011-08-16T08:00:34Z


I'm going to test with the Fusion Inventory version RC2 and I've the model well.

Howewer, I can't upgrade to this version, can you help me in order find a solution in the version 2.3.x ?