glpi-project / glpi-agent

GLPI Agent
GNU General Public License v2.0
250 stars 61 forks source link

Pb in opensolaris/openindiana #50

Closed CorentinS6 closed 2 years ago

CorentinS6 commented 2 years ago

Bug reporting acknowledgment

Yes, I read it

Professional support

No response

Describe the bug

Hello,

When executing remote task (with glpi-agent --tasks remoteinventory) i get this output :

Use of uninitialized value $id in pattern match (m//) at /usr/share/glpi-agent/lib/GLPI/Agent/Tools/Solaris.pm line 380.
Use of uninitialized value in numeric gt (>) at /usr/share/glpi-agent/lib/GLPI/Agent/Task/Inventory/Virtualization/SolarisZones.pm line 75.
Use of uninitialized value in numeric eq (==) at /usr/share/glpi-agent/lib/GLPI/Agent/Task/Inventory/Virtualization/SolarisZones.pm line 75.

Config :

Best regards

To reproduce

just run glpi-agent remote task for a server with openindiana 151.

Expected behavior

no error message

Operating system

Linux, Other (See additional context below)

GLPI Agent version

1.0

GLPI version

9.5.6

GLPIInventory plugin or FusionInventory for GLPI plugin version

9.5+3.0

Additional context

No response

g-bougard commented 2 years ago

Hi @CorentinS6

Thank you for your submission.

To handle your issue, can you provide the content of /etc/release file on the remote host if it exists ? This is related to the check to enable virtualization inventory on global zone.

As a side question, are you using a user having sufficient rights to read that /etc/release file for your remote inventory ?

CorentinS6 commented 2 years ago

Hello, The /etc/release content :

             OpenIndiana Development oi_151.1.9 X86 (powered by illumos)
        Copyright 2011 Oracle and/or its affiliates. All rights reserved.
                        Use is subject to license terms.
                           Assembled 17 January 2014

The inventory is made with root privileges (in the both servers).

Regards

g-bougard commented 2 years ago

Hi @CorentinS6 can you try to apply 6115e50 on your GLPI-Agent to validate OpenIndiana Support PR #52 ?

CorentinS6 commented 2 years ago

Hello

The messages have disappeared, but inventory is poor :

Regards

g-bougard commented 2 years ago

Maybe OpenIndiana has too diverged from Solaris. We may investigate if you're able to provide some related file contents or command outputs. Do you find SolarisZones if you have some setup ?

g-bougard commented 2 years ago

Here are some commands that are run during Solaris inventory:

For bios/hardware, outputs of uname -m and showrev are read. Then on 'i386', output of /usr/sbin/smbios For other archs, this is output of /usr/sbin/prtconf -vp Also the output of sneep or /opt/SUNWsneep/bin/sneep can be used.

For controllers, following command output is required: cfgadm -s cols=ap_id:type:info

For cpu, outputs of /usr/sbin/psrinfo -v and /usr/sbin/psrinfo -vp are needed

For drives, we read the following command outputs: df -P -k if df --version contains GNU df -k otherwise but also /usr/sbin/mount -v

For hardware, we need outputs of following commands: arch -k uname -p uname -i hostid zonename if host is a global zone: /usr/sbin/zoneadm -z global list -p output is required on sparc, we need /usr/sbin/zoneadm list -p output

For memory and slots, we analyse /usr/sbin/prtconf, /usr/sbin/swap -l and prtdiag outputs.

For network we starts with: ifconfig -a output and than make some checks

For os: We get /etc/release content. We need also uname -v and hostid outputs hostid

For software: pkg info if pkg present otherwise we try pkginfo -l

For storage: we analyze iostat -En and make other checks

If you're aware of new usages or changes introduced by OpenIndiana, let us know.

CorentinS6 commented 2 years ago

Hello, Tank you for your replies. The results :

uname -m

i86pc

showrev

-bash: showrev : commande introuvable

/usr/sbin/smbios & /usr/sbin/prtconf -vp

seems work (very long output).

(sneep = -bash: sneep : commande introuvable)

cfgadm -s cols=ap_id:type:info

Ap_Id Type Information c3 scsi-bus usb8/1 unknown usb8/2 unknown usb9/1 unknown usb9/2 unknown usb10/1 unknown usb10/2 unknown usb10/3 usb-hub Mfg: Product: NConfigs: 1 Config: 0 usb10/3.1 unknown usb10/3.2 unknown usb10/3.3 unknown usb10/3.4 unknown usb10/4 unknown usb11/1 unknown usb11/2 usb-device Mfg: Avocent Product: USB Composite Device-0 NConfigs: 1 Config: 0 usb12/1 unknown usb12/2 unknown usb13/1 unknown usb13/2 unknown usb14/1 unknown usb14/2 unknown usb15/1 unknown usb15/2 unknown usb15/3 unknown usb15/4 unknown

arch -k

i86pc

uname -p

i386

uname -i

i86pc

hostid

00000000

zonename

global

/usr/sbin/zoneadm -z global list -p

0:global:running:/::ipkg:shared

/usr/sbin/zoneadm list -p

0:global:running:/::ipkg:shared

/usr/sbin/prtconf

System Configuration:  Project OpenIndiana  i86pc
Memory size: 32756 Megabytes
System Peripherals (Software Nodes):

i86pc
    scsi_vhci, instance #0
    pci, instance #0
        pci1028,2f1 (driver not attached)
        pci8086,3408, instance #0
            pci1028,2f1, instance #0
            pci1028,2f1, instance #1
        pci8086,340a, instance #1
            pci1028,1f17, instance #0
                sd, instance #1
                sd, instance #2
        pci8086,340e (driver not attached)
        pci8086,3410 (driver not attached)
        pci8086,3411 (driver not attached)
        pci8086,342e (driver not attached)
        pci8086,3422 (driver not attached)
        pci8086,3423, instance #0
        pci1028,2f1, instance #0
        pci1028,2f1, instance #1
        pci1028,2f1, instance #0
            hub, instance #0
        pci1028,2f1, instance #2
            device, instance #0
                keyboard, instance #0
                mouse, instance #1
        pci1028,2f1, instance #3
        pci1028,2f1, instance #4
        pci1028,2f1, instance #5
        pci1028,2f1, instance #1
        pci8086,244e, instance #0
            display, instance #0
        isa, instance #0
            motherboard (driver not attached)
            motherboard (driver not attached)
            asy, instance #0
            asy, instance #1
            motherboard (driver not attached)
            motherboard (driver not attached)
            pit_beep, instance #0
    pci, instance #0
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
    pci, instance #1
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
        pci8086,8086 (driver not attached)
    fw, instance #0
        cpu (driver not attached)
        cpu (driver not attached)
        cpu (driver not attached)
        cpu (driver not attached)
        cpu (driver not attached)
        cpu (driver not attached)
        cpu (driver not attached)
        cpu (driver not attached)
        cpu (driver not attached)
        cpu (driver not attached)
        cpu (driver not attached)
        cpu (driver not attached)
        cpu (driver not attached)
        cpu (driver not attached)
        cpu (driver not attached)
        cpu (driver not attached)
        sb, instance #1
    motherboard (driver not attached)
    used-resources (driver not attached)
    iscsi, instance #0
    agpgart, instance #0
    options, instance #0
    pseudo, instance #0

/usr/sbin/swap -l

swapfile             dev    swaplo   blocks     free
/dev/zvol/dsk/rpool1/swap 100,2         8 33542136 33542136

prtdiag
System Configuration: Dell Inc. PowerEdge R510
BIOS Configuration: Dell Inc. 1.8.2 08/23/2011
BMC Configuration: IPMI 2.0 (KCS: Keyboard Controller Style)

==== Processor Sockets ====================================

Version                          Location Tag
-------------------------------- --------------------------
Intel(R) Xeon(R) CPU           E5620  @ 2.40GHz CPU1
Intel(R) Xeon(R) CPU           E5620  @ 2.40GHz CPU2

==== Memory Device Sockets ================================

Type        Status Set Device Locator      Bank Locator
----------- ------ --- ------------------- ----------------
Unknown     in use 1   DIMM_A1             
Unknown     in use 1   DIMM_A2             
Unknown     in use 2   DIMM_A3             
Unknown     in use 2   DIMM_A4             
Unknown     in use 5   DIMM_B1             
Unknown     in use 6   DIMM_B2             
Unknown     in use 6   DIMM_B3             
Unknown     in use 4   DIMM_B4             

==== On-Board Devices =====================================
Embedded Matrox G200 Video
Embedded Broadcom 5716 NIC 1
Embedded Broadcom 5716 NIC 2

==== Upgradeable Slots ====================================

ID  Status    Type             Description
--- --------- ---------------- ----------------------------
1   available Unknown          PCI1
2   available Unknown          PCI2
3   available Unknown          PCI3
4   in use    Unknown          PCI4

ifconfig -a


lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000 
bnx0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet *.*.*.* netmask ffffff00 broadcast *.*.*.*
        ether aa:aa:aa:aa:aa:aa
lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1
        inet6 ::1/128 
bnx0: flags=20002000840<RUNNING,MULTICAST,IPv6> mtu 1500 index 2
        inet6 ::/0 
        ether bb:bb:bb:bb:bb:bb

cat /etc/release

        OpenIndiana Development oi_151.1.9 X86 (powered by illumos)
    Copyright 2011 Oracle and/or its affiliates. All rights reserved.
                    Use is subject to license terms.
                       Assembled 17 January 2014

uname -v

oi_151a9

hostid

00000000

pkg info send a list like :


          Name: archiver/gnu-tar
       Summary: gtar - GNU tar
   Description: GNU tar - A utility used to store, backup, and transport files
                (gtar) 1.23
      Category: Development/GNU
         State: Installed
     Publisher: openindiana.org
       Version: 1.23
 Build Release: 5.11
        Branch: 0.151.1.9
Packaging Date: 17 janvier 2014 20:16:45 
          Size: 2.47 MB
          FMRI: pkg://openindiana.org/archiver/gnu-tar@1.23,5.11-0.151.1.9:20140117T201645Z

          Name: compress/gzip
       Summary: The GNU Zip (gzip) compression utility
   Description: The GNU Zip (gzip) compression utility 1.5
      Category: Applications/System Utilities
         State: Installed
     Publisher: openindiana.org
       Version: 1.5
 Build Release: 5.11
        Branch: 0.151.1.9
Packaging Date: 17 janvier 2014 20:17:05 
          Size: 235.71 kB
          FMRI: pkg://openindiana.org/compress/gzip@1.5,5.11-0.151.1.9:20140117T201705Z

iostat -En

c3t0d0           Soft Errors: 0 Hard Errors: 0 Transport Errors: 0 
Vendor: DELL Product: PERC H700 Revision: 2.10 Serial No: xxxxxxxxxxxxxx
Size: 107,37GB <107374182400 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0 
Illegal Request: 1 Predictive Failure Analysis: 0
c3t1d0           Soft Errors: 0 Hard Errors: 0 Transport Errors: 0 
Vendor: DELL Product: PERC H700 Revision: 2.10 Serial No: xxxxxxxxxxxxxx
Size: 19891,07GB <19891067289600 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0 
Illegal Request: 1 Predictive Failure Analysis: 0 
g-bougard commented 2 years ago

Hi @CorentinS6 I finally found an issue with the remoteinventory task so it failed to support other unix systems than linux. This is fixed in a55d50d. I also merged #52 in which I made few improvements for OpenIndiana inventory. Please try next nightly build to validate you can inventory your OpenIndiana system.