glpi-project / glpi-inventory-plugin

GLPI Inventory plugin
GNU Affero General Public License v3.0
46 stars 27 forks source link

GLPI Inventory not linking with Computers ITEM 0 #487

Closed CSpencerLTD closed 6 months ago

CSpencerLTD commented 6 months ago

Describe the bug

Please help or point me in the direction of diagnosing this problem.

So for about 15 machines out of 210, these machines are not linking. All the rest have been fine, they have all linked up. However some machines have linked with ITEM 0. I have reinstalled the agent multiple times and it doesn't change the error, on other machines they work find and submit the inventory.

2024-03-01 09_01_00-Agents - GLPI

There is nothing in the import log to say why it was refused. 2024-03-05 10_40_07-Agent - CSL9180-2024-03-05-09-11-58 - GLPI

These are the rules we have enabled, as I want to link everything that is in GLPI asset already and not create new assets,

2024-03-05 10_42_27-Rules - GLPI 2024-03-05 10_42_41-Rules - GLPI

Log file On the log file of the inventory I get the below, if I turn off "Enable Inventory" I get the usual error so it is detecting that GLPI server is accepting Inventories

 [Fri Mar  1 08:56:31 2024][info] target server0: server https://xxx.xxx/marketplace/glpiinventory
[Fri Mar  1 08:56:31 2024][info] sending contact request to server0
[Fri Mar  1 08:56:32 2024][info] sending prolog request to server0
[Fri Mar  1 08:56:32 2024][info] running task Inventory
[Fri Mar  1 08:56:32 2024][info] New inventory from xxxx-2024-02-29-08-40-58 for server0 (tag=xxxx)
[Fri Mar  1 08:57:18 2024][info] running task Deploy
[Fri Mar  1 08:57:18 2024][info] No Deploy job enabled or Deploy support disabled server side.
[Fri Mar  1 08:57:19 2024][info] running task Collect
[Fri Mar  1 08:57:19 2024][info] No Collect job enabled or Collect support disabled server side.
[Fri Mar  1 08:57:19 2024][info] target server0: next run: Sat Mar  2 08:43:51 2024 - https://xxxx.xxx/marketplace/glpiinventory
[Fri Mar  1 08:57:19 2024][info] GLPI Agent memory usage: WSS=3731456 PFU=147005440

I have found this in the php-errors.log

glpiphplog.WARNING:   *** PHP Warning (2): Undefined array key "action" in /var/www/glpi/src/Inventory/Asset/MainAsset.php at line 592
  Backtrace :
  src/Inventory/Inventory.php:724                    Glpi\Inventory\Asset\MainAsset->handle()
  src/Inventory/Inventory.php:355                    Glpi\Inventory\Inventory->handleItem()
  src/Inventory/Request.php:364                      Glpi\Inventory\Inventory->doInventory()
  src/Inventory/Request.php:90                       Glpi\Inventory\Request->inventory()
  src/Agent/Communication/AbstractRequest.php:359    Glpi\Inventory\Request->handleAction()
  src/Agent/Communication/AbstractRequest.php:271    Glpi\Agent\Communication\AbstractRequest->handleJSONRequest()
  front/inventory.php:95                             Glpi\Agent\Communication\AbstractRequest->handleRequest()
  ...tplace/glpiinventory/front/communication.php:72 include_once()
  marketplace/glpiinventory/index.php:45             include_once()
  public/index.php:82                                require()[2024-03-05 09:59:10] glpiphplog.DEBUG: Html::compileScss() in /var/www/glpi/src/Html.php line 6910
Compile marketplace/formcreator/css/styles.scss  {"user":"4809@GLPI10"}
[2024-03-05 09:59:55] glpiphplog.WARNING:   *** PHP Warning (2): Undefined array key "action" in /var/www/glpi/src/Inventory/Asset/MainAsset.php at line 592
  Backtrace :
  src/Inventory/Inventory.php:724                    Glpi\Inventory\Asset\MainAsset->handle()
  src/Inventory/Inventory.php:355                    Glpi\Inventory\Inventory->handleItem()
  src/Inventory/Request.php:364                      Glpi\Inventory\Inventory->doInventory()
  src/Inventory/Request.php:90                       Glpi\Inventory\Request->inventory()
  src/Agent/Communication/AbstractRequest.php:359    Glpi\Inventory\Request->handleAction()
  src/Agent/Communication/AbstractRequest.php:271    Glpi\Agent\Communication\AbstractRequest->handleJSONRequest()
  front/inventory.php:95                             Glpi\Agent\Communication\AbstractRequest->handleRequest()
  ...tplace/glpiinventory/front/communication.php:72 include_once()
  marketplace/glpiinventory/index.php:45             include_once()
  public/index.php:82                                require()

To reproduce

  1. This is the first time we have used GLPI Inventory (We have finally switched from OCS) and we have migrated up GLPI from previous versions and now sat on 10.0.12
  2. Rolled out the GLPI agent via OCS to install on mass using a batch script. Out of 200 machines only 10 machines have not linked and don't understand why.
  3. I have the deleted the agent from GLPI and then forced the inventory again using 127.0.0.1:62354, the agent the appears again in GLPI so I know it has contacted it correctly but it does not link.

Expected behavior

I am expecting it to link with the items already in GLPI like the items that have already linked.

Operating system

Windows

GLPI Agent version

Other (See additional context below)

GLPI version

10.0.12

GLPIInventory plugin

1.3.5

Additional context

GLPI Inventory Agent is 1.7.1

Also amazing tool, we really liked the agent when we was testing it on our testbed version of GLPI, the patch management is ace in comparison.

trasher commented 6 months ago

What you describe looks like a rules issue. Try with a fresh installation or after a rules reset (with default rules); and if you do not reproduce, there is not much we can do. Inspecting your specific rules and find what you maybe done wrong is out of the scope of this bug tracker.