glpi-project / glpi-agent

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

BIOS report on raspberry #630

Closed bigred38 closed 3 months ago

bigred38 commented 3 months ago

Bug reporting acknowledgment

Yes, I read it

Professional support

Still not applicable

Describe the bug

I use fusion-inventory on raspberries on which I have a BIOS entry with a serial number (OS is Debian Buster). On Raspberries in Bookworm version I use the latest version of Glpi-Agent. I no longer have a BIOS entry with the serial number. Is this a regression?

To reproduce

  1. Glpi-Agent inventory on Raspberry Debian OS Bookworm
  2. doesn't have BIOS catégorie

Expected behavior

I'm trying to have serial number

Operating system

Linux

GLPI Agent version

1.7.1

GLPI version

10.0.x (See additional context below)

GLPIInventory plugin or other plugin version

GLPI Inventory v1.3.5

Additional context

No response

g-bougard commented 3 months ago

Hi @bigred38

if I remember well, the bios data is taken from /proc/cpuinfo file content on such arm platform. Can you check the content on the 2 cases ? And eventually share the one ffrom the Bookworm case ?

I don't think this is a regression as we use the same code from FI-Agent. But maybe this is a platform or OS evolution and we can then enhance GLPI-Agent. What's the difference for the Raspberries hardware in the 2 cases ?

bigred38 commented 3 months ago

Yes it's not a regression, but I can find the information on the /proc/cpuinfo : Revision : a02082 Serial : 00000000438df421 Model : Raspberry Pi 3 Model B Rev 1.2 But nothing on the inventory

bigred38 commented 3 months ago

the same, I can't get the model of the pi

g-bougard commented 3 months ago

Okay, then maybe the agent doesn't detect it runs on ARM arch.

Can you share the output of the following command ?

perl -MConfig -e 'print $Config{archname}, "\n"'
g-bougard commented 3 months ago

Can you also share the full content of /proc/cpuinfo ? Not just what you expect the agent should analyze.

bigred38 commented 3 months ago

perl -MConfig -e 'print $Config{archname}, "\n"'

aarch64-linux-gnu-thread-multi

bigred38 commented 3 months ago

Can you also share the full content of /proc/cpuinfo ? Not just what you expect the agent should analyze.

processor : 0 BogoMIPS : 38.40 Features : fp asimd evtstrm crc32 cpuid CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x0 CPU part : 0xd03 CPU revision : 4

processor : 1 BogoMIPS : 38.40 Features : fp asimd evtstrm crc32 cpuid CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x0 CPU part : 0xd03 CPU revision : 4

processor : 2 BogoMIPS : 38.40 Features : fp asimd evtstrm crc32 cpuid CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x0 CPU part : 0xd03 CPU revision : 4

processor : 3 BogoMIPS : 38.40 Features : fp asimd evtstrm crc32 cpuid CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x0 CPU part : 0xd03 CPU revision : 4

Revision : a02082 Serial : 00000000438df421 Model : Raspberry Pi 3 Model B Rev 1.2

g-bougard commented 3 months ago

Thank you, nice !

Can you first try to modify lib/GLPI/Agent/Task/Inventory/Linux/ARM.pm applying the following patch ?

diff --git a/lib/GLPI/Agent/Task/Inventory/Linux/ARM.pm b/lib/GLPI/Agent/Task/Inventory/Linux/ARM.pm
index 688df62e3..5187bde58 100644
--- a/lib/GLPI/Agent/Task/Inventory/Linux/ARM.pm
+++ b/lib/GLPI/Agent/Task/Inventory/Linux/ARM.pm
@@ -13,7 +13,7 @@ sub isEnabled {
     my (%params) = @_;

     return Uname("-m") =~ /^arm|aarch64/ if $params{remote};
-    return $Config{archname} =~ /^arm/;
+    return $Config{archname} =~ /^(arm|aarch64)/;
 }
g-bougard commented 3 months ago

Then you may try to apply this patch to catch the model:

diff --git a/lib/GLPI/Agent/Task/Inventory/Linux/ARM/Board.pm b/lib/GLPI/Agent/Task/Inventory/Linux/ARM/Board.pm
index 8f946f99d..3f170c5ae 100644
--- a/lib/GLPI/Agent/Task/Inventory/Linux/ARM/Board.pm
+++ b/lib/GLPI/Agent/Task/Inventory/Linux/ARM/Board.pm
@@ -34,7 +34,7 @@ sub _getBios {
         # List of well-known inventory values we can import
         # Search for cpuinfo value from the given list
         my %infos = (
-            MMODEL  => [ 'hardware' ],
+            MMODEL  => [ 'hardware', 'model' ],
             MSN     => [ 'revision' ],
             SSN     => [ 'serial' ]
         );
bigred38 commented 3 months ago

amazing it works

g-bougard commented 3 months ago

Great, I'll include these patches for the 1.8 version and they will still be available in nightly builds.

g-bougard commented 3 months ago

I also updated the CPU.pm to report 'aarch64' in place of 'arm' as ARCH in your case.