You are not logged in.
Hi.
I wasnt able to find this exact issue here, if it was already asked, sorry.
I'm trying to configure the GLPI Agent, and it appears that combination of the official GLPI Inventory plugin with native inventory does not work for me.
Agent only works with only native inventory (so without the plugin). I also tried FusionInventory with their agent, and that works.
The only error I get is this:
[error] [http client] unexpected content, starting with: <?xml version="1.0" encoding="UTF-8" ?>
[error] No answer from server at http://server/glpi/plugins/glpiinventory/
According to the documentation, the GLPI Agent is configured correctly, the URL must point to the plugins folder. And as mentioned, FusionInventory (as plugin) works.
Any ideas what am I doing wrong?
Thanks in advance
Offline
If you are still using fusioninventory then: http://server/glpi/plugins/fusioninventory/
If you are using glpi agents without fusioniventory (only with GLPI 10): http://server/glpi/front/inventory.php or http://server/front/inventory.php
Last edited by WebGreg (2022-05-12 12:32:14)
--
GLPI 10.0.17
GLPI-Inventory 1.4.0
Ubuntu Server 20.04 LTS
Offline
We are not using Fusion. This is a fresh v10 install.
We want the functions that the GLPI plugin adds, so the URL (according to this - glpi-agent.readthedocs.io/en/latest/configuration.html#available-parameters) should be server/glpi/plugins/glpiinventory since we added the plugin manually, not via marketplace. And that does not work.
So I just want to know if this is a bug, or I did something wrong or didn't set something properly. I've read the documentation and didn't see any additional steps mentioned to configure the GLPI plugin to work with the GLPI agent.
Offline
(according to this - glpi-agent.readthedocs.io/en/latest/configuration.html#available-parameters) should be server/glpi/plugins/glpiinventory
Have you tried with the address I give you?
I don't know what functions you are talking about. I installed it with such an address and agents report to me in the plugin, I can create inventory tasks and send them to agents.
Last edited by WebGreg (2022-05-12 16:45:14)
--
GLPI 10.0.17
GLPI-Inventory 1.4.0
Ubuntu Server 20.04 LTS
Offline
Sorry, yes I did try even before posting here. I get the same error
I mean functions like shown here: ibb.co/WBfP5Jd
Offline
Hi jan_t,
a lot of people have no problem to use GlpiInventory plugin. Only telling this is not working with just "[error] [http client] unexpected content, starting with: <?xml version="1.0" encoding="UTF-8" ?>" as reported error is not sufficient to answer you if this is a bug or a configuration problem.
As you explained you read the doc, I can trust you about the url configuration. Anyway when having trouble, you should share more of the agent log but you also need to tell which agent version you're using, which GLPI 10 version (I guess the 10.0.0 but always remind it), and the same for GLPI Inventory plugin. Also you should tell if you have other plugins... like OCS which seems to make trouble with other plugins like GlpiInventory: so if you have OCSInventory plugin, please try to disable it or check if they released an update.
GLPI-Agent developer from Teclib' and GLPI-Network team
Previously FusionInventory-Agent maintainer
Offline
Hi gbougard,
thanks for reply.
So far, I've tried the stable 1.2 agent, but also 1.3 nightly builds (currently gitca4fb407), no change. Yes, GLPI is 10.0.0 and were only using Oauth IMAP (1.4.0) and Behaviours (2.6.0), plus the GLPI Inventory (1.0.0).
I've tested the FusionInventory plugin but after test, it was removed completely.
The GLPI agent is installed with deploy and collect support, running as Windows Service.
This is the full log from the GLPI agent.
[Tue May 17 10:50:19 2022][info] GLPI Agent service starting
[Tue May 17 10:50:19 2022][info] [http server] HTTPD service started on port 62354
[Tue May 17 10:50:21 2022][info] GLPI Agent memory usage: WSS=3702784 PFU=103956480
[Tue May 17 10:50:21 2022][info] target server0: next run: Tue May 17 11:39:24 2022 - http://server/glpi/plugins/glpiinventory
[Tue May 17 10:50:38 2022][info] target server0: server http://server/glpi/plugins/glpiinventory
[Tue May 17 10:50:38 2022][info] sending prolog request to server0
[Tue May 17 10:50:39 2022][error] [http client] unexpected content, starting with: <?xml version="1.0" encoding="UTF-8" ?>
[Tue May 17 10:50:39 2022][error] No answer from server at http://server/glpi/plugins/glpiinventory
[Tue May 17 10:50:39 2022][info] target server0: next run: Tue May 17 10:51:39 2022 - http://server/glpi/plugins/glpiinventory
If I remove the plugin and set the url to /glpi/front/inventory.php, then it works.
Offline
Hi jan_t,
thank you that's farly better.
First, are you sure you need "/glpi/" part ?
Then can you enable debug=2 level ?
I see one thing weird, but maybe that's because you're in debug=0 level: the agent seems to start directly with prolog but it should switch to json contact as it should detect it is communicating with GLPI 10. You may want to remove or moved elsewhere all sub-folders into the "C:\Program Files\GLPI-Agent\var" folder to re-initialize how the agent see your server. Did you have agent older than 1.2 that was run on this computer ?
GLPI-Agent developer from Teclib' and GLPI-Network team
Previously FusionInventory-Agent maintainer
Offline
Yes, its running in the GLPI folder, "/glpi/" is needed. But just to be sure I also tried without, and error was clear:
[error] [http client] communication error: 404 Not Found
No, we started with agent 1.2, no older version were installed on the machine.
I cleared the var folder, and tried again. Heres the debug level 2 log. I removed the machine ID and the scanned content, hope thats ok and not needed for diagnosis:
[Tue May 17 12:45:44 2022][debug] [http server] GET request / from client 127.0.0.1
[Tue May 17 12:45:44 2022][debug] [http server] response status 200
[Tue May 17 12:45:50 2022][debug] [http server] HTTPD service stopped
[Tue May 17 12:45:50 2022][info] GLPI Agent exiting (17804)
[Tue May 17 12:46:37 2022][debug] Logger backend File initialized
[Tue May 17 12:46:37 2022][debug] GLPI Agent (1.3-gitca4fb407)
[Tue May 17 12:46:37 2022][debug] Configuration directory: C:/Program Files/GLPI-Agent/etc
[Tue May 17 12:46:37 2022][debug] Data directory: C:/Program Files/GLPI-Agent/share
[Tue May 17 12:46:38 2022][debug] Storage directory: C:\Program Files\GLPI-Agent\var
[Tue May 17 12:46:38 2022][debug] Lib directory: C:/Program Files/GLPI-Agent/perl/agent
[Tue May 17 12:46:38 2022][debug] [target server0] Next server contact planned for Tue May 17 13:29:55 2022
[Tue May 17 12:46:38 2022][debug2] getAvailableTasks() : add of task Collect version 2.8
[Tue May 17 12:46:38 2022][debug2] getAvailableTasks() : add of task Deploy version 2.10
[Tue May 17 12:46:38 2022][debug2] getAvailableTasks() : add of task Inventory version 1.11
[Tue May 17 12:46:38 2022][debug2] getAvailableTasks() : add of task RemoteInventory version 1.0
[Tue May 17 12:46:38 2022][debug] Available tasks:
[Tue May 17 12:46:38 2022][debug] - Collect: 2.8
[Tue May 17 12:46:38 2022][debug] - Deploy: 2.10
[Tue May 17 12:46:38 2022][debug] - Inventory: 1.11
[Tue May 17 12:46:38 2022][debug] - RemoteInventory: 1.0
[Tue May 17 12:46:38 2022][debug] target server0: server http://server/glpi/plugins/glpiinventory
[Tue May 17 12:46:38 2022][debug] Planned tasks for server0: Collect,Deploy,Inventory,RemoteInventory
[Tue May 17 12:46:38 2022][debug] Provided by Teclib Edition
[Tue May 17 12:46:38 2022][debug] Installer built on Mon May 9 18:08:07 2022 UTC
[Tue May 17 12:46:38 2022][debug] Built with Strawberry Perl 5.34.1
[Tue May 17 12:46:38 2022][debug] Built on github actions windows image for glpi-project/glpi-agent repository
[Tue May 17 12:46:38 2022][info] GLPI Agent service starting
[Tue May 17 12:46:38 2022][debug] Trusted client ip: 127.0.0.1/32, ::ffff:7f00:1/128, ::1/128
[Tue May 17 12:46:38 2022][debug] [http server] Trying to load Inventory Server plugin
[Tue May 17 12:46:38 2022][debug] [inventory server plugin] Initializing Inventory v1.1 Server plugin...
[Tue May 17 12:46:38 2022][debug] [inventory server plugin] Loading Inventory Server plugin configuration from C:/Program Files/GLPI-Agent/etc/inventory-server-plugin.cfg
[Tue May 17 12:46:38 2022][debug] [target listener] Next tasks run planned for Tue May 17 13:35:40 2022
[Tue May 17 12:46:38 2022][debug] [http server] HTTPD Inventory Server plugin loaded but disabled
[Tue May 17 12:46:38 2022][debug] [http server] Trying to load Proxy Server plugin
[Tue May 17 12:46:38 2022][debug] [proxy server plugin] Initializing Proxy v2.1 Server plugin...
[Tue May 17 12:46:38 2022][debug] [proxy server plugin] Loading Proxy Server plugin configuration from C:/Program Files/GLPI-Agent/etc/proxy-server-plugin.cfg
[Tue May 17 12:46:38 2022][debug] [http server] HTTPD Proxy Server plugin loaded but disabled
[Tue May 17 12:46:38 2022][debug] [http server] Trying to load SecondaryProxy Server plugin
[Tue May 17 12:46:38 2022][debug] [proxy2 server plugin] Initializing SecondaryProxy v1.1 Server plugin...
[Tue May 17 12:46:38 2022][debug] [proxy2 server plugin] Loading SecondaryProxy Server plugin configuration from C:/Program Files/GLPI-Agent/etc/proxy2-server-plugin.cfg
[Tue May 17 12:46:38 2022][debug] [http server] HTTPD SecondaryProxy Server plugin loaded but disabled
[Tue May 17 12:46:38 2022][debug] [http server] Trying to load SSL Server plugin
[Tue May 17 12:46:38 2022][debug] [ssl server plugin] Initializing SSL v1.1 Server plugin...
[Tue May 17 12:46:38 2022][debug] [ssl server plugin] Loading SSL Server plugin configuration from C:/Program Files/GLPI-Agent/etc/ssl-server-plugin.cfg
[Tue May 17 12:46:38 2022][debug] [http server] HTTPD SSL Server plugin loaded but disabled
[Tue May 17 12:46:38 2022][debug] [http server] Trying to load Test Server plugin
[Tue May 17 12:46:38 2022][debug] [server test plugin] Initializing Test v1.3-gitca4fb407 Server plugin...
[Tue May 17 12:46:38 2022][debug] [server test plugin] Loading Test Server plugin configuration from C:/Program Files/GLPI-Agent/etc/server-test-plugin.cfg
[Tue May 17 12:46:38 2022][debug] [http server] HTTPD Test Server plugin loaded but disabled
[Tue May 17 12:46:38 2022][debug] [http server] Trying to load ToolBox Server plugin
[Tue May 17 12:46:38 2022][debug] [toolbox plugin] Initializing ToolBox v1.0 Server plugin...
[Tue May 17 12:46:38 2022][debug] [toolbox plugin] Loading ToolBox Server plugin configuration from C:/Program Files/GLPI-Agent/etc/toolbox-plugin.cfg
[Tue May 17 12:46:38 2022][debug] [http server] HTTPD ToolBox Server plugin loaded but disabled
[Tue May 17 12:46:38 2022][info] [http server] HTTPD service started on port 62354
[Tue May 17 12:46:38 2022][debug2] Looking for Win32_Processor class WMI objects
[Tue May 17 12:46:39 2022][debug] Agent memory usage before freeing memory: WSS=114774016 PFU=104316928
[Tue May 17 12:46:39 2022][info] GLPI Agent memory usage: WSS=3018752 PFU=104316928
[Tue May 17 12:46:39 2022][debug] Running in background mode
[Tue May 17 12:46:39 2022][info] target server0: next run: Tue May 17 13:29:55 2022 - http://server/glpi/plugins/glpiinventory
[Tue May 17 12:48:50 2022][debug] target server0: storage maintenance event for deploy task
[Tue May 17 12:48:50 2022][debug] new thread 3 to handle task Deploy
[Tue May 17 12:48:50 2022][info] running task Deploy: storage maintenance event
[Tue May 17 12:48:50 2022][debug] Deploy task storage maintenance event for server0 target
[Tue May 17 12:48:50 2022][debug] No need to plan another storage maintenance event for server0 target
[Tue May 17 12:48:52 2022][debug] Agent memory usage before freeing memory: WSS=92016640 PFU=113807360
[Tue May 17 12:48:52 2022][info] GLPI Agent memory usage: WSS=3092480 PFU=113807360
[Tue May 17 12:48:53 2022][debug] [http server] GET request / from client 127.0.0.1
[Tue May 17 12:48:53 2022][debug] [http server] response status 200
[Tue May 17 12:48:56 2022][debug] [http server] GET request /now from client 127.0.0.1
[Tue May 17 12:48:56 2022][debug] [http server] rescheduling next contact for all targets right now
[Tue May 17 12:48:56 2022][debug] [http server] response status 200
[Tue May 17 12:48:57 2022][info] target server0: server http://server/glpi/plugins/glpiinventory
[Tue May 17 12:48:57 2022][debug] [http client] Using Compress::Zlib for compression
[Tue May 17 12:48:57 2022][info] sending prolog request to server0
[Tue May 17 12:48:57 2022][debug2] [http client] sending message:
<?xml version="1.0" encoding="UTF-8" ?>
<REQUEST>
<DEVICEID>machine-2022-05-17-12-41-57</DEVICEID>
<QUERY>PROLOG</QUERY>
<TOKEN>12345678</TOKEN>
</REQUEST>
[Tue May 17 12:48:57 2022][debug2] format: Plaintext
[Tue May 17 12:48:57 2022][debug2] [http client] receiving message:
<?xml version="1.0" encoding="UTF-8" ?>
<REQUEST>
<CONTENT>
</CONTENT>
</REQUEST>
[Tue May 17 12:48:57 2022][error] [http client] unexpected content, starting with: <?xml version="1.0" encoding="UTF-8" ?>
[Tue May 17 12:48:57 2022][error] No answer from server at http://server/glpi/plugins/glpiinventory
[Tue May 17 12:48:57 2022][info] target server0: next run: Tue May 17 12:49:57 2022 - http://server/glpi/plugins/glpiinventory
[Tue May 17 12:48:57 2022][debug] [http server] GET request / from client 127.0.0.1
[Tue May 17 12:48:57 2022][debug] [http server] response status 200
Offline
Hi all,
I have the same problem as jan_t, i hope we can have a solution
Thank you all
Offline
Hi jan_t,
thank you for your effort. It still shows as I told that the agent doesn't recognize your GLPI server as a GLPI 10 server. I think that's a symptom and there's maybe a problem on server-side so.
Do you see any exception in the GLPI php-errors.log logged at the same time you're forcing the agent to run ?
GLPI-Agent developer from Teclib' and GLPI-Network team
Previously FusionInventory-Agent maintainer
Offline
Hi.
Nothing in the php-errors.log after I forced the inventory. No errors from the GLPI plugin in whole log from the start. At least I didnt find anything. Should I look for something specific?
Offline
Hi,
indeed, I really need the content of the server answer but you seem to have stripped it:
[Tue May 17 12:48:57 2022][debug2] [http client] receiving message:
<?xml version="1.0" encoding="UTF-8" ?>
<REQUEST>
<CONTENT>
</CONTENT>
</REQUEST>
The received message here must be a valid xml but I can't validate it. Is it possible there's a non UTF-8 character in it ?
GLPI-Agent developer from Teclib' and GLPI-Network team
Previously FusionInventory-Agent maintainer
Offline
I'm not comfortable sharing the whole log here publicly. Is it possible to send you PM?
But me and colleague checked our logs in Notepad++ for non-UTF8 chars and it was clean.
XML validation also passed.
Edit: for some weird reason, looking at the content, its now scanning the server where GLPI is running, and not the machine where the agent is running?
Last edited by jan_t (2022-05-19 14:00:53)
Offline
Hi jan_t
you can send me the log to gbougard _at_ teclib _dot_ com.
I don't understand your "edit" and the problem with "scanning".
GLPI-Agent developer from Teclib' and GLPI-Network team
Previously FusionInventory-Agent maintainer
Offline
Fast forward two months, and I can say it finally works. We updated GLPI to 10.0.2, updated the GLPI inventory plugin to 1.0.3, and with Agent 1.0.4, it finally works. We did not make any changes to PHP, DB, etc.
Offline
Bonjour,
Je me permets de rebondir sur vos échanges et souhaite savoir ce que vous avez fait pour le bon fonctionnement de l'agent GLPI.
J'ai mis à jour notre GLPI à le dernière version 10.0.5 et installé le GLPI-AGENT. en status tout semble être bien configuré mais dés que je lance la commande glpi-agent en mode debug ( niveau 2), j'ai le résultat suivant :
[debug] Logger backend Stderr initialized
[debug] GLPI Agent (1.4-1)
[debug] Configuration directory: /etc/glpi-agent
[debug] Data directory: /usr/share/glpi-agent
[debug] Storage directory: /var/lib/glpi-agent
[debug] Lib directory: /usr/share/glpi-agent/lib
[debug] [target server0] Next server contact planned for Thu Dec 15 16:02:22 2022
[debug] Available tasks:
[debug] - Inventory: 1.12
[debug] - NetDiscovery: 5.1
[debug] - NetInventory: 5.1
[debug] - RemoteInventory: 1.0
[debug] - WakeOnLan: 2.2
[debug] target server0: server h..p://X.X.X.X/front/inventory.php
[debug] Planned tasks for server0: WakeOnLan,NetInventory,NetDiscovery,RemoteInventory,Inventory
[debug] Built by Debian
[debug] Source time: 2022-07-01 09:21
[debug] Running in foreground mode
[info] target server0: server h..p://X.X.X.X/front/inventory.php
[debug] [http client] Using Compress::Zlib for compression
[info] sending prolog request to server0
[error] [http client] communication error: 404 Not Found
[error] No answer from server at h..p://X.X.X.X/front/inventory.php
En vous remerciant pour votre aide
Last edited by Amina (2022-12-15 16:30:05)
Online
Bonjour,
C'est toujours moi. J'ai oublié de mentionné que dans mon fichier agant.cfg j'ai mis l'URL suivante : server = h..p://x.x.x.x/glpi/marketplace/glpiinventory/front/ mais elle n'est pas prise en considération après redémarrage du service et lancement du glpi-agent
[debug] Logger backend Stderr initialized
[debug] GLPI Agent (1.4-1)
[debug] Configuration directory: /etc/glpi-agent
[debug] Data directory: /usr/share/glpi-agent
[debug] Storage directory: /var/lib/glpi-agent
[debug] Lib directory: /usr/share/glpi-agent/lib
[debug] [target server0] Next server contact planned for Thu Dec 15 16:36:03 2022
[debug2] getAvailableTasks() : add of task Inventory version 1.12
[debug2] getAvailableTasks() : add of task NetDiscovery version 5.1
[debug2] getAvailableTasks() : add of task NetInventory version 5.1
[debug2] getAvailableTasks() : add of task RemoteInventory version 1.0
[debug2] getAvailableTasks() : add of task WakeOnLan version 2.2
[debug] Available tasks:
[debug] - Inventory: 1.12
[debug] - NetDiscovery: 5.1
[debug] - NetInventory: 5.1
[debug] - RemoteInventory: 1.0
[debug] - WakeOnLan: 2.2
[debug] target server0: server h..p://x.x.x.x/front/inventory.php
[debug] Planned tasks for server0: RemoteInventory,NetDiscovery,WakeOnLan,NetInventory,Inventory
[debug] Built by Debian
[debug] Source time: 2022-07-01 09:21
[debug] Running in foreground mode
[info] target server0: server h..p://x.x.x.x/front/inventory.php
[debug] [http client] Using Compress::Zlib for compression
[info] sending prolog request to server0
[debug2] [http client] sending message:
<?xml version="1.0" encoding="UTF-8" ?>
<REQUEST>
<DEVICEID>-2022-12-15-12-01-41</DEVICEID>
<QUERY>PROLOG</QUERY>
<TOKEN>12345678</TOKEN>
</REQUEST>
[error] [http client] communication error: 404 Not Found
[error] No answer from server at h..p://x.x.x.x/front/inventory.php
Online
Bonjour Amina,
tu aurais mieux fait d'ouvrir un nouveau fil de discussion.
Sinon, si l'agent ne prend pas en compte la mise à jour de ta configuration, c'est peut-être que tu n'as pas édité le bon fichier. Quel est le chemin complet du fichier que tu as édité ?
De façon général, une réponse du serveur "404 Not found" indique que l'url n'est pas correcte. Quelle URL utilises-tu depuis un navigateur pour accéder à ton GLPI ? Si je me fie à ce que tu sembles vouloir définir, la bonne url devrait être "server = h..p://x.x.x.x/glpi/marketplace/glpiinventory/" sans "/front" à la fin.
GLPI-Agent developer from Teclib' and GLPI-Network team
Previously FusionInventory-Agent maintainer
Offline
Bonjour M BOUGARD,
Je vous remercie pour votre retour.
Le chemin complet du fichier que j'ai édité est /etc/glpi-agent/agent.cfg
C'est via l'URL suivante que j'accede à mon GLPI : h..p://x.x.x.x/glpi
En web si je clique sur GLPI Inventory ça me redirige vie l'URL suivante : h..p://x.x.x.x/glpi/marketplace/glpiinventory/front/menu.php
J'ai du l'installer et désinstallé plusieurs fois mais ça ne marche toujours pas ....
Online
Bonjour,
Après plusieurs essais, j'ai fini par désinstallé le plugin et installé que l'agent intégré par défaut mais malheureusement, j'ai de nouveau un autre problème dans l'interface web.
J'ai bien mon agent par contre dans Administration-->Inventaire lorsque je clique sur "Règles d'import et de liaison des équipements" ou bien sur "Règles d'affectation d'un élément à une entité" j'ai le message suivant qui s'affiche "Uncaught Exception TypeError: Argument 1 passed to Session::getRightNameForError() must be of the type int, string given, called in /var/www/glpi/src/CommonDBTM.php on line 3046 in /var/www/glpi/src/Session.php at line 992"
Alors je me suis rendu sur le serveur "/var/www/glpi/src/Session.php" et modifier le type de "int" à 'string" la variable rignt comme suit : public static function getRightNameForError(string $right): string
Une fois ces modifications faites. lorsque je clique à nouveau ça m'affiche : "
Vous n'avez pas les droits requis pour réaliser cette action. "
et donc je me retrouve à nouveau bloquée pour mon inventaire.
Je vous en serai reconnaissante si vous avez des solutions à m'apporter.
Cordialement,
Online