ocsinventoryng icon indicating copy to clipboard operation
ocsinventoryng copied to clipboard

Automatic import doesn't import anything

Open thenamelessthing opened this issue 4 years ago • 20 comments

For bug reports, you can open an issue here, provide us :

  • Plugin 1.7.3
  • GLPI 9.5.5
  • OCS 2.9.0

After initial import of all computer I setup the automatic action to run every 5 min. In the task log I see the task run successfully. But newly added computer in OCS are not imported into GLPI.

image

image

If I do an import manually, I can see the newly added computer from OCS.

image

thenamelessthing avatar Mar 18 '22 12:03 thenamelessthing

The automatic task ocsng is launched only if server is not in expert mode The automatic task ocsng only synchronize existant computers, it doesn't import new computers If you want to import new computers, disable this parameter, change to expert mode and use script from system

https://github.com/pluginsGLPI/ocsinventoryng/wiki/Massive-import---Expert-Mode

tsmr avatar Mar 18 '22 13:03 tsmr

In expert mode same problem. I have enabled the debug and now I see these error:

image

thenamelessthing avatar Mar 18 '22 14:03 thenamelessthing

Try with last https://github.com/pluginsGLPI/ocsinventoryng/archive/refs/heads/9.5/bugfixes.zip

Verify your user / password to access ocs database

tsmr avatar Mar 18 '22 14:03 tsmr

Thank you, we are progressing!

image

Now I notice that this task doesn't seem to sync existing computers. I don't see the changes going up in GLPI, for example software that is no longer inventoried on a workstation is still visible in GLPI.

thenamelessthing avatar Mar 18 '22 14:03 thenamelessthing

The --thread_nbr= option mean the number of process for the sync task or the number of computer synced for the task?

thenamelessthing avatar Mar 18 '22 15:03 thenamelessthing

The --thread_nbr= option mean the number of process for the sync task

tsmr avatar Mar 18 '22 15:03 tsmr

@tsmr do you have any idea where I could check, to understand why the sync is not working even though I no longer have an error when running the script?

Je parle français aussi si c'est plus simple pour toi.

thenamelessthing avatar Mar 18 '22 15:03 thenamelessthing

Cela est censé synchroniser aussi les pcs. Mais cela dépends du checksum coté OCS. Si tu forces l'import complet, il devrait mettre à jour les logiciels normalement

tsmr avatar Mar 18 '22 15:03 tsmr

Si je lance la synchro manuellement par l'interface web de GLPI tout fonctionne. Je coche tout les ordinateurs ayant du nouveau contenu et une fois lancé cela prendre quelques minutes.

Si j'utilise le script sa roule quelques secondes et il n'y a aucune erreur. C'est comme si le script ne sélectionnait pas aucun ordinateur à synchroniser...

thenamelessthing avatar Mar 18 '22 16:03 thenamelessthing

il compare les dates entre OCS et GLPI - donc si pas de modification, pas de synchro déclenchée if (strtotime($computer['META']["LASTDATE"]) > strtotime($data["last_update"])) {

tsmr avatar Mar 18 '22 16:03 tsmr

Autre élément que je ne comprend pas, dans la documentation du mode expert. C'est indiqué qu'on pouvait suivre en temps réel l'exécution.

image

Mais je n'ai pas de lien vers ce plugin.. image

thenamelessthing avatar Mar 18 '22 17:03 thenamelessthing

Outils > OCS Inventory NG image

tsmr avatar Mar 18 '22 18:03 tsmr

Je n'ai pas cette option et j'ai fait le tour de pas mal tout les menus de l'interface... Je ne retrouve pas cette option. Je précise que je suis connecté avec l'utilisateur glpi qui est super-admin.

msedge_2022-03-18_14-05-14

thenamelessthing avatar Mar 18 '22 18:03 thenamelessthing

Dans la configuration du serveur : image

tsmr avatar Mar 19 '22 09:03 tsmr

Oulà! Je me sens vraiment Noob d'être passer à côté de ça! Un énorme merci pour ton aide. J'espère que ce ticket pourra être utile à d'autres.

thenamelessthing avatar Mar 21 '22 12:03 thenamelessthing

Malgré le fait que je vois la tâche cron s'exécuter. C'est normal que je ne vois toujours rien dans cet écran?

image

Si j'ai bien compris j'ai modifier "refresh information of a process every" de la valeur 0 à 30 sec.

image

thenamelessthing avatar Mar 21 '22 13:03 thenamelessthing

Je me répond à moi-même, il faut que la tâche cron soit fait à partir du compte root.

thenamelessthing avatar Mar 21 '22 15:03 thenamelessthing

Dernière question, est-ce qu'il y a moyen de supprimer les ordinateurs dans OCS ou du moins les "ARCHIVER" lorsque l'on met un ordinateur avec un état spécifique (ex: état "Décommissionner")

thenamelessthing avatar Mar 21 '22 15:03 thenamelessthing

image

tsmr avatar Mar 21 '22 15:03 tsmr

ok, j'imagine que si j'active ce paramètre. Je dois indiquer d'une quelconque façon une "règle ou une action" qui indique que lorsque l'état "décomissionner" est choisi alors exécute "utiliser l'action automatique de nettoyage des agents & suppression depuis OCSNG"..???

thenamelessthing avatar Mar 21 '22 17:03 thenamelessthing