glpi-project / glpi

GLPI is a Free Asset and IT Management Software package, Data center management, ITIL Service Desk, licenses tracking and software auditing.
https://glpi-project.org
GNU General Public License v3.0
4.29k stars 1.29k forks source link

netdiscovery and netinventory do not work correctly. #11592

Closed Molina15 closed 2 years ago

Molina15 commented 2 years ago

Code of Conduct

Is there an existing issue for this?

Version

10.0

Bug description

discovery network task (GLPI inventory), does not create the network devices it discovers in the added networks (IP range). Network inventory doesn't work either.

I use agent 1.3 for windows 10. The .bat scripts (discovery and inventory) perform the scan and generate the xml files for me if I run them manually from CMD. But if I try to make an injector, it gives me an error.

Attached screenshots of results and configuration:

image It says that it has been done successfully but in network device the discovered devices do not appear.

image Create a network device and manually configure the ip on one of the ports. The same case, it tells me OK but it doesn't update me at all on the device.

image discovery network log (0 devices imported)

image I don't know what I should expect from this.

Relevant log output

I try to injector the netdiscovery xml files in two different server paths

C:\Program Files\GLPI-Agent>.\glpi-injector.bat -v -f 192.168.15.15.xml --url http://192.168.100.42/glpi/front/inventory.php --debug --debug
Loading 192.168.15.15.xml...[A8D12762] ERROR: Unexpected empty server response
DEBUG:
These elements were not sent:
192.168.15.15.xml

C:\Program Files\GLPI-Agent>.\glpi-injector.bat -v -f 192.168.15.15.xml --url http://incidencies.calafell.org/glpi/marketplace/glpiinventory/ --debug --debug
Loading 192.168.15.15.xml...[DCAEE836] ERROR: Unexpected empty server response
DEBUG:
These elements were not sent:
192.168.15.15.xml

Attached agent logs.

[Mon May 16 11:41:44 2022][debug] Built with Strawberry Perl 5.34.1
[Mon May 16 11:41:44 2022][debug] Built on github actions windows image for glpi-project/glpi-agent repository
[Mon May 16 11:41:44 2022][debug] Running in foreground mode
[Mon May 16 11:41:44 2022][info] server0 is not ready yet, next server contact planned for Tue May 17 08:49:33 2022
[Mon May 16 12:28:01 2022][debug] Logger backend File initialized
[Mon May 16 12:28:01 2022][debug] GLPI Agent (1.3-gitca4fb407)
[Mon May 16 12:28:01 2022][debug] Configuration directory: C:/Program Files/GLPI-Agent/etc
[Mon May 16 12:28:01 2022][debug] Data directory: C:/Program Files/GLPI-Agent/share
[Mon May 16 12:28:01 2022][debug] Storage directory: C:\Program Files\GLPI-Agent\var
[Mon May 16 12:28:01 2022][debug] Lib directory: C:/Program Files/GLPI-Agent/perl/agent
[Mon May 16 12:28:01 2022][debug] [target server0] Next server contact planned for Tue May 17 08:49:33 2022
[Mon May 16 12:28:01 2022][debug2] getAvailableTasks() : add of task Collect version 2.8
[Mon May 16 12:28:01 2022][debug2] getAvailableTasks() : add of task Deploy version 2.10
[Mon May 16 12:28:01 2022][debug2] getAvailableTasks() : add of task ESX version 2.7
[Mon May 16 12:28:01 2022][debug2] getAvailableTasks() : add of task Inventory version 1.11
[Mon May 16 12:28:01 2022][debug2] getAvailableTasks() : add of task NetDiscovery version 5.1
[Mon May 16 12:28:01 2022][debug2] getAvailableTasks() : add of task NetInventory version 5.1
[Mon May 16 12:28:01 2022][debug2] getAvailableTasks() : add of task RemoteInventory version 1.0
[Mon May 16 12:28:01 2022][debug] Available tasks:
[Mon May 16 12:28:01 2022][debug] - Collect: 2.8
[Mon May 16 12:28:01 2022][debug] - Deploy: 2.10
[Mon May 16 12:28:01 2022][debug] - ESX: 2.7
[Mon May 16 12:28:01 2022][debug] - Inventory: 1.11
[Mon May 16 12:28:01 2022][debug] - NetDiscovery: 5.1
[Mon May 16 12:28:01 2022][debug] - NetInventory: 5.1
[Mon May 16 12:28:01 2022][debug] - RemoteInventory: 1.0
[Mon May 16 12:28:01 2022][debug] target server0: server http://192.168.100.42/glpi/front/inventory.php
[Mon May 16 12:28:01 2022][debug] Planned tasks for server0: NetDiscovery,Inventory,ESX,Collect,Deploy,RemoteInventory,NetInventory
[Mon May 16 12:28:01 2022][debug] Provided by Teclib Edition
[Mon May 16 12:28:01 2022][debug] Installer built on Mon May  9 18:08:07 2022 UTC
[Mon May 16 12:28:01 2022][debug] Built with Strawberry Perl 5.34.1
[Mon May 16 12:28:01 2022][debug] Built on github actions windows image for glpi-project/glpi-agent repository
[Mon May 16 12:28:02 2022][debug] Running in foreground mode
[Mon May 16 12:28:02 2022][info] server0 is not ready yet, next server contact planned for Tue May 17 08:49:33 2022

apache2/error log It tells me that the error is in ocsinventoryng?????????? I have ocs installed, that's a problem? I run injector to the glpiinventory folder

[Mon May 16 13:45:07.410135 2022] [php7:notice] [pid 326397] [client 192.168.182.185:59446] PHP Notice:  Undefined index: ocsservers_id in /var/www/glpi/plugins/ocsinventoryng/hook.php on line 1348
[Mon May 16 13:45:07.410246 2022] [php7:notice] [pid 326397] [client 192.168.182.185:59446] PHP Notice:  Undefined index: id in /var/www/glpi/plugins/ocsinventoryng/hook.php on line 1360
[Mon May 16 13:45:07.522295 2022] [php7:notice] [pid 327694] [client 192.168.182.185:59447] PHP Notice:  Undefined index: ocsservers_id in /var/www/glpi/plugins/ocsinventoryng/hook.php on line 1348
[Mon May 16 13:45:07.522381 2022] [php7:notice] [pid 327694] [client 192.168.182.185:59447] PHP Notice:  Undefined index: id in /var/www/glpi/plugins/ocsinventoryng/hook.php on line 1360
[Mon May 16 13:57:00.149911 2022] [php7:notice] [pid 322109] [client 192.168.182.185:59887] PHP Notice:  Undefined index: ocsservers_id in /var/www/glpi/plugins/ocsinventoryng/hook.php on line 1348
[Mon May 16 13:57:00.150041 2022] [php7:notice] [pid 322109] [client 192.168.182.185:59887] PHP Notice:  Undefined index: id in /var/www/glpi/plugins/ocsinventoryng/hook.php on line 1360

apache2/acces.log

192.168.182.185 - - [16/May/2022:13:45:07 +0200] "POST /marketplace/glpiinventory/ HTTP/1.1" 200 409 "-" "GLPI-Injector"
192.168.182.185 - - [16/May/2022:13:45:07 +0200] "POST /marketplace/glpiinventory/ HTTP/1.1" 200 409 "-" "GLPI-Injector"
192.168.182.185 - - [16/May/2022:13:45:07 +0200] "POST /marketplace/glpiinventory/ HTTP/1.1" 200 409 "-" "GLPI-Injector"
192.168.182.185 - - [16/May/2022:13:45:07 +0200] "POST /marketplace/glpiinventory/ HTTP/1.1" 200 409 "-" "GLPI-Injector"
192.168.182.185 - - [16/May/2022:13:45:07 +0200] "POST /marketplace/glpiinventory/ HTTP/1.1" 200 409 "-" "GLPI-Injector"

In the agent I have tried to configure both the address of the GLPI inventory plugin ... /marketplace/glpiinventory/ and ... /front/inventory.php

Molina15 commented 2 years ago

Ok, I think I solved something. I have deactivated the OCS plugin and now I can load both discovery and inventory XMLs manually with injector. It remains to be seen if the agent does it on his own, in case he closes the incident. It seems that there is a bug between OCSinventory and GLPI inventory (although the agent of this second one is only configured to search for networks)

trasher commented 2 years ago

Sounds like a plugin issue, please report on their side