J'ai constaté un problème avec deux options de l'onglet "Import de l'inventaire" :
Ordinateurs importés par la synchronisation automatique
Ordinateurs non importés par la synchronisation automatique
Elles ne retournent jamais de résultats, par contre elles engendrent des erreurs SQL dans les logs. Les requêtes générées comportent plusieurs erreurs concernant des références à des items absents des tables de la base de donnée glpi :
L'option "Ordinateurs non importés par la synchronisation automatique" génère par exemple la requête suivante:
SELECT DISTINCT glpi_plugin_ocsinventoryng_notimportedcomputers.id AS id, 'pierre.francois.roll' AS currentuser,
glpi_plugin_ocsinventoryng_notimportedcomputers.ocsid AS ocsid,
glpi_plugin_ocsinventoryng_notimportedcomputers.ocsid AS ocsid,
glpi_plugin_ocsinventoryng_notimportedcomputers.plugin_ocsinventoryng_ocsservers_id AS plugin_ocsinventoryng_ocsservers_id, glpi_entities.completename AS completename,
glpi_entities.ocsid AS ocsid,
glpi_entities.plugin_ocsinventoryng_ocsservers_id AS plugin_ocsinventoryng_ocsservers_id, glpi_plugin_ocsinventoryng_notimportedcomputers.name AS name,
glpi_plugin_ocsinventoryng_notimportedcomputers.ocsid AS ocsid,
glpi_plugin_ocsinventoryng_notimportedcomputers.plugin_ocsinventoryng_ocsservers_id AS plugin_ocsinventoryng_ocsservers_id, glpi_plugin_ocsinventoryng_notimportedcomputers.useragent AS useragent,
glpi_plugin_ocsinventoryng_notimportedcomputers.ocsid AS ocsid,
glpi_plugin_ocsinventoryng_notimportedcomputers.plugin_ocsinventoryng_ocsservers_id AS plugin_ocsinventoryng_ocsservers_id, glpi_plugin_ocsinventoryng_notimportedcomputers.ocs_deviceid AS ocs_deviceid,
glpi_plugin_ocsinventoryng_notimportedcomputers.ocsid AS ocsid,
glpi_plugin_ocsinventoryng_notimportedcomputers.plugin_ocsinventoryng_ocsservers_id AS plugin_ocsinventoryng_ocsservers_id, glpi_plugin_ocsinventoryng_ocsservers.name AS name,
glpi_plugin_ocsinventoryng_ocsservers.ocsid AS ocsid,
glpi_plugin_ocsinventoryng_ocsservers.plugin_ocsinventoryng_ocsservers_id AS plugin_ocsinventoryng_ocsservers_id, glpi_plugin_ocsinventoryng_notimportedcomputers.tag AS tag,
glpi_plugin_ocsinventoryng_notimportedcomputers.ocsid AS ocsid,
glpi_plugin_ocsinventoryng_notimportedcomputers.plugin_ocsinventoryng_ocsservers_id AS plugin_ocsinventoryng_ocsservers_id, glpi_plugin_ocsinventoryng_notimportedcomputers.ipaddr AS ipaddr,
glpi_plugin_ocsinventoryng_notimportedcomputers.ocsid AS ocsid,
glpi_plugin_ocsinventoryng_notimportedcomputers.plugin_ocsinventoryng_ocsservers_id AS plugin_ocsinventoryng_ocsservers_id, glpi_plugin_ocsinventoryng_notimportedcomputers.domain AS domain,
glpi_plugin_ocsinventoryng_notimportedcomputers.ocsid AS ocsid,
glpi_plugin_ocsinventoryng_notimportedcomputers.plugin_ocsinventoryng_ocsservers_id AS plugin_ocsinventoryng_ocsservers_id, glpi_plugin_ocsinventoryng_notimportedcomputers.last_inventory AS last_inventory,
glpi_plugin_ocsinventoryng_notimportedcomputers.ocsid AS ocsid,
glpi_plugin_ocsinventoryng_notimportedcomputers.plugin_ocsinventoryng_ocsservers_id AS plugin_ocsinventoryng_ocsservers_id, glpi_plugin_ocsinventoryng_notimportedcomputers.reason AS reason,
glpi_plugin_ocsinventoryng_notimportedcomputers.ocsid AS ocsid,
glpi_plugin_ocsinventoryng_notimportedcomputers.plugin_ocsinventoryng_ocsservers_id AS plugin_ocsinventoryng_ocsservers_id FROM glpi_plugin_ocsinventoryng_notimportedcomputersLEFT JOIN glpi_entities
ON (glpi_plugin_ocsinventoryng_notimportedcomputers.entities_id = glpi_entities.id
)LEFT JOIN glpi_plugin_ocsinventoryng_ocsservers
ON (glpi_plugin_ocsinventoryng_notimportedcomputers.plugin_ocsinventoryng_ocsservers_id = glpi_plugin_ocsinventoryng_ocsservers.id
) WHERE ( 1 ) ORDER BY ITEM_PluginOcsinventoryngNotimportedcomputer_1 ASC LIMIT 0, 30
glpi_entities.ocsid n'existe pas par exemple.
L'option "Ordinateurs importés par la synchronisation automatique" génère par exemple la requête suivante:
SELECT DISTINCT glpi_plugin_ocsinventoryng_details.id AS id, 'pierre.francois.roll' AS currentuser,
glpi_plugin_ocsinventoryng_details.ocsid AS ocsid,
glpi_plugin_ocsinventoryng_details.ocsid AS ocsid,
glpi_plugin_ocsinventoryng_details.plugin_ocsinventoryng_ocsservers_id AS plugin_ocsinventoryng_ocsservers_id, glpi_plugin_ocsinventoryng_details.plugin_ocsinventoryng_threads_id,
glpi_plugin_ocsinventoryng_details.threadid, glpi_entities.completename AS completename,
glpi_entities.ocsid AS ocsid,
glpi_entities.plugin_ocsinventoryng_ocsservers_id AS plugin_ocsinventoryng_ocsservers_id, glpi_entities.plugin_ocsinventoryng_threads_id,
glpi_entities.threadid, glpi_plugin_ocsinventoryng_threads.processid AS processid,
glpi_plugin_ocsinventoryng_threads.ocsid AS ocsid,
glpi_plugin_ocsinventoryng_threads.plugin_ocsinventoryng_ocsservers_id AS plugin_ocsinventoryng_ocsservers_id, glpi_plugin_ocsinventoryng_threads.plugin_ocsinventoryng_threads_id,
glpi_plugin_ocsinventoryng_threads.threadid, glpi_plugin_ocsinventoryng_ocsservers.name AS name,
glpi_plugin_ocsinventoryng_ocsservers.ocsid AS ocsid,
glpi_plugin_ocsinventoryng_ocsservers.plugin_ocsinventoryng_ocsservers_id AS plugin_ocsinventoryng_ocsservers_id, glpi_plugin_ocsinventoryng_ocsservers.plugin_ocsinventoryng_threads_id,
glpi_plugin_ocsinventoryng_ocsservers.threadid, glpi_plugin_ocsinventoryng_details.process_time AS process_time,
glpi_plugin_ocsinventoryng_details.ocsid AS ocsid,
glpi_plugin_ocsinventoryng_details.plugin_ocsinventoryng_ocsservers_id AS plugin_ocsinventoryng_ocsservers_id, glpi_plugin_ocsinventoryng_details.plugin_ocsinventoryng_threads_id,
glpi_plugin_ocsinventoryng_details.threadid, glpi_plugin_ocsinventoryng_details.action AS action,
glpi_plugin_ocsinventoryng_details.ocsid AS ocsid,
glpi_plugin_ocsinventoryng_details.plugin_ocsinventoryng_ocsservers_id AS plugin_ocsinventoryng_ocsservers_id, glpi_plugin_ocsinventoryng_details.plugin_ocsinventoryng_threads_id,
glpi_plugin_ocsinventoryng_details.threadid, glpi_plugin_ocsinventoryng_details.computers_id AS computers_id,
glpi_plugin_ocsinventoryng_details.ocsid AS ocsid,
glpi_plugin_ocsinventoryng_details.plugin_ocsinventoryng_ocsservers_id AS plugin_ocsinventoryng_ocsservers_id, glpi_plugin_ocsinventoryng_details.plugin_ocsinventoryng_threads_id,
glpi_plugin_ocsinventoryng_details.threadid FROM glpi_plugin_ocsinventoryng_detailsLEFT JOIN glpi_entities
ON (glpi_plugin_ocsinventoryng_details.entities_id = glpi_entities.id
)LEFT JOIN glpi_plugin_ocsinventoryng_threads
ON (glpi_plugin_ocsinventoryng_details.plugin_ocsinventoryng_threads_id = glpi_plugin_ocsinventoryng_threads.id
)LEFT JOIN glpi_plugin_ocsinventoryng_ocsservers
ON (glpi_plugin_ocsinventoryng_details.plugin_ocsinventoryng_ocsservers_id = glpi_plugin_ocsinventoryng_ocsservers.id
) WHERE ( 1 ) ORDER BY ITEM_PluginOcsinventoryngDetail_1 ASC LIMIT 0, 30
A force de corrections, il est possible d'obtenir en requête sans erreurs et donc un résultat, mais est-ce bien celui attendu par le plugin tel qu'il a été conçu ?
Version du plugin 1.6.0 Version de GLPI 4.4.2
Bonjour,
J'ai constaté un problème avec deux options de l'onglet "Import de l'inventaire" :
Elles ne retournent jamais de résultats, par contre elles engendrent des erreurs SQL dans les logs. Les requêtes générées comportent plusieurs erreurs concernant des références à des items absents des tables de la base de donnée glpi :
SELECT DISTINCT
glpi_plugin_ocsinventoryng_notimportedcomputers
.id
AS id, 'pierre.francois.roll' AS currentuser,glpi_plugin_ocsinventoryng_notimportedcomputers
.ocsid
AS ocsid,glpi_plugin_ocsinventoryng_notimportedcomputers
.ocsid
AS ocsid,glpi_plugin_ocsinventoryng_notimportedcomputers
.plugin_ocsinventoryng_ocsservers_id
AS plugin_ocsinventoryng_ocsservers_id,glpi_entities
.completename
AS completename,glpi_entities
.ocsid
AS ocsid,glpi_entities
.plugin_ocsinventoryng_ocsservers_id
AS plugin_ocsinventoryng_ocsservers_id,glpi_plugin_ocsinventoryng_notimportedcomputers
.name
AS name,glpi_plugin_ocsinventoryng_notimportedcomputers
.ocsid
AS ocsid,glpi_plugin_ocsinventoryng_notimportedcomputers
.plugin_ocsinventoryng_ocsservers_id
AS plugin_ocsinventoryng_ocsservers_id,glpi_plugin_ocsinventoryng_notimportedcomputers
.useragent
AS useragent,glpi_plugin_ocsinventoryng_notimportedcomputers
.ocsid
AS ocsid,glpi_plugin_ocsinventoryng_notimportedcomputers
.plugin_ocsinventoryng_ocsservers_id
AS plugin_ocsinventoryng_ocsservers_id,glpi_plugin_ocsinventoryng_notimportedcomputers
.ocs_deviceid
AS ocs_deviceid,glpi_plugin_ocsinventoryng_notimportedcomputers
.ocsid
AS ocsid,glpi_plugin_ocsinventoryng_notimportedcomputers
.plugin_ocsinventoryng_ocsservers_id
AS plugin_ocsinventoryng_ocsservers_id,glpi_plugin_ocsinventoryng_ocsservers
.name
AS name,glpi_plugin_ocsinventoryng_ocsservers
.ocsid
AS ocsid,glpi_plugin_ocsinventoryng_ocsservers
.plugin_ocsinventoryng_ocsservers_id
AS plugin_ocsinventoryng_ocsservers_id,glpi_plugin_ocsinventoryng_notimportedcomputers
.tag
AS tag,glpi_plugin_ocsinventoryng_notimportedcomputers
.ocsid
AS ocsid,glpi_plugin_ocsinventoryng_notimportedcomputers
.plugin_ocsinventoryng_ocsservers_id
AS plugin_ocsinventoryng_ocsservers_id,glpi_plugin_ocsinventoryng_notimportedcomputers
.ipaddr
AS ipaddr,glpi_plugin_ocsinventoryng_notimportedcomputers
.ocsid
AS ocsid,glpi_plugin_ocsinventoryng_notimportedcomputers
.plugin_ocsinventoryng_ocsservers_id
AS plugin_ocsinventoryng_ocsservers_id,glpi_plugin_ocsinventoryng_notimportedcomputers
.domain
AS domain,glpi_plugin_ocsinventoryng_notimportedcomputers
.ocsid
AS ocsid,glpi_plugin_ocsinventoryng_notimportedcomputers
.plugin_ocsinventoryng_ocsservers_id
AS plugin_ocsinventoryng_ocsservers_id,glpi_plugin_ocsinventoryng_notimportedcomputers
.last_inventory
AS last_inventory,glpi_plugin_ocsinventoryng_notimportedcomputers
.ocsid
AS ocsid,glpi_plugin_ocsinventoryng_notimportedcomputers
.plugin_ocsinventoryng_ocsservers_id
AS plugin_ocsinventoryng_ocsservers_id,glpi_plugin_ocsinventoryng_notimportedcomputers
.reason
AS reason,glpi_plugin_ocsinventoryng_notimportedcomputers
.ocsid
AS ocsid,glpi_plugin_ocsinventoryng_notimportedcomputers
.plugin_ocsinventoryng_ocsservers_id
AS plugin_ocsinventoryng_ocsservers_id FROMglpi_plugin_ocsinventoryng_notimportedcomputers
LEFT JOINglpi_entities
ON (glpi_plugin_ocsinventoryng_notimportedcomputers
.entities_id
=glpi_entities
.id
)LEFT JOINglpi_plugin_ocsinventoryng_ocsservers
ON (glpi_plugin_ocsinventoryng_notimportedcomputers
.plugin_ocsinventoryng_ocsservers_id
=glpi_plugin_ocsinventoryng_ocsservers
.id
) WHERE ( 1 ) ORDER BY ITEM_PluginOcsinventoryngNotimportedcomputer_1 ASC LIMIT 0, 30glpi_entities
.ocsid
n'existe pas par exemple.SELECT DISTINCT
glpi_plugin_ocsinventoryng_details
.id
AS id, 'pierre.francois.roll' AS currentuser,glpi_plugin_ocsinventoryng_details
.ocsid
AS ocsid,glpi_plugin_ocsinventoryng_details
.ocsid
AS ocsid,glpi_plugin_ocsinventoryng_details
.plugin_ocsinventoryng_ocsservers_id
AS plugin_ocsinventoryng_ocsservers_id,glpi_plugin_ocsinventoryng_details
.plugin_ocsinventoryng_threads_id
,glpi_plugin_ocsinventoryng_details
.threadid
,glpi_entities
.completename
AS completename,glpi_entities
.ocsid
AS ocsid,glpi_entities
.plugin_ocsinventoryng_ocsservers_id
AS plugin_ocsinventoryng_ocsservers_id,glpi_entities
.plugin_ocsinventoryng_threads_id
,glpi_entities
.threadid
,glpi_plugin_ocsinventoryng_threads
.processid
AS processid,glpi_plugin_ocsinventoryng_threads
.ocsid
AS ocsid,glpi_plugin_ocsinventoryng_threads
.plugin_ocsinventoryng_ocsservers_id
AS plugin_ocsinventoryng_ocsservers_id,glpi_plugin_ocsinventoryng_threads
.plugin_ocsinventoryng_threads_id
,glpi_plugin_ocsinventoryng_threads
.threadid
,glpi_plugin_ocsinventoryng_ocsservers
.name
AS name,glpi_plugin_ocsinventoryng_ocsservers
.ocsid
AS ocsid,glpi_plugin_ocsinventoryng_ocsservers
.plugin_ocsinventoryng_ocsservers_id
AS plugin_ocsinventoryng_ocsservers_id,glpi_plugin_ocsinventoryng_ocsservers
.plugin_ocsinventoryng_threads_id
,glpi_plugin_ocsinventoryng_ocsservers
.threadid
,glpi_plugin_ocsinventoryng_details
.process_time
AS process_time,glpi_plugin_ocsinventoryng_details
.ocsid
AS ocsid,glpi_plugin_ocsinventoryng_details
.plugin_ocsinventoryng_ocsservers_id
AS plugin_ocsinventoryng_ocsservers_id,glpi_plugin_ocsinventoryng_details
.plugin_ocsinventoryng_threads_id
,glpi_plugin_ocsinventoryng_details
.threadid
,glpi_plugin_ocsinventoryng_details
.action
AS action,glpi_plugin_ocsinventoryng_details
.ocsid
AS ocsid,glpi_plugin_ocsinventoryng_details
.plugin_ocsinventoryng_ocsservers_id
AS plugin_ocsinventoryng_ocsservers_id,glpi_plugin_ocsinventoryng_details
.plugin_ocsinventoryng_threads_id
,glpi_plugin_ocsinventoryng_details
.threadid
,glpi_plugin_ocsinventoryng_details
.computers_id
AS computers_id,glpi_plugin_ocsinventoryng_details
.ocsid
AS ocsid,glpi_plugin_ocsinventoryng_details
.plugin_ocsinventoryng_ocsservers_id
AS plugin_ocsinventoryng_ocsservers_id,glpi_plugin_ocsinventoryng_details
.plugin_ocsinventoryng_threads_id
,glpi_plugin_ocsinventoryng_details
.threadid
FROMglpi_plugin_ocsinventoryng_details
LEFT JOINglpi_entities
ON (glpi_plugin_ocsinventoryng_details
.entities_id
=glpi_entities
.id
)LEFT JOINglpi_plugin_ocsinventoryng_threads
ON (glpi_plugin_ocsinventoryng_details
.plugin_ocsinventoryng_threads_id
=glpi_plugin_ocsinventoryng_threads
.id
)LEFT JOINglpi_plugin_ocsinventoryng_ocsservers
ON (glpi_plugin_ocsinventoryng_details
.plugin_ocsinventoryng_ocsservers_id
=glpi_plugin_ocsinventoryng_ocsservers
.id
) WHERE ( 1 ) ORDER BY ITEM_PluginOcsinventoryngDetail_1 ASC LIMIT 0, 30A force de corrections, il est possible d'obtenir en requête sans erreurs et donc un résultat, mais est-ce bien celui attendu par le plugin tel qu'il a été conçu ?