Skip to main content

Injecter un inventaire manuellement

Il est possible d'injecter un fichier d'inventaire manuellement.

Il est nécessaire de récupérer l'url d'injection dans la configuration du substitut inventory. Cette configuration se trouve dans le fichier /etc/pulse-xmpp-agent-substitute/agent_master_substitute_inv.ini.local

[glpi]
url_to_forward = http://server/glpi/plugins/glpiinventory/front/plugin_fusioninventory.communication.php

 

L'injection du fichier /root/inventaire.xml, se fait avec la commande suivante:

curl -X POST --data @/root/inventaire.xml -H "Content-Type: text/xml" -H "Pragma: no-cache" -H "User-Agent: siveo-injector" "http://server/glpi/plugins/glpiinventory/front/plugin_fusioninventory.communication.php" -v

Le résultat de cette commande est :

Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying 127.0.1.1:80...
* Connected to server (127.0.1.1) port 80 (#0)
> POST /glpi/plugins/glpiinventory/front/plugin_fusioninventory.communication.php HTTP/1.1
> Host: server
> Accept: */*
> Content-Type: text/xml
> Pragma: no-cache
> User-Agent: siveo-injector
> Content-Length: 158882
> 
* We are completely uploaded and fine
< HTTP/1.1 200 OK
< Date: Tue, 22 Sep 2026 10:33:17 GMT
< Server: Apache/2.4.68 (Debian)
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Accept: */*
< Cache-Control: no-cache,no-store
< Connection: close
< Pragma: no-cache
< Set-Cookie: glpi_ce733d4c447bd364f7347dd340193517=bghti4qjaq1h3ggss5v95shv47; path=/; HttpOnly
< Vary: Accept-Encoding
< Transfer-Encoding: chunked
< Content-Type: application/xml
< 
<?xml version="1.0"?>
* Closing connection 0
<REPLY><RESPONSE>SEND</RESPONSE></REPLY>

Le statut de la réponse est 200, cela signifie que l'injection s'est bien effectuée.