You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2022-05-03 10:14:14

Feike
Member
Registered: 2009-02-02
Posts: 47

Glpi Agent additional content

In our school we only once do an inventory of new computers.
We have to add 5 additional data: entity, inventory number, type of computer, user and location.
Until now we used ocsng were I can add extra fields for these data and make a rule for putting the pc in the correct entity.
Now we want to switch to the glpi agent in our windows environment.
I do glpi-inventory.bat > pc.xml and then glpi-injector.bat --file pc.xml --url https://glpi/front/inventory.php.
This works just fine.
After testing I come to the conclusion I can add two of the five, inventory  number and type of computer, with the --additional-content parameter.
The other three, entity, user and location , I don't see a solution.
Am I correct or is there a solution I didn't find?

I think I will make a small program that will pass these data to a php script that then will check if the pc is added to glpi and then add the data to the pc.

Offline

#2 2022-05-09 11:18:58

gbougard
Moderator
From: Montpellier, France
Registered: 2021-07-21
Posts: 537
Website

Re: Glpi Agent additional content

Hi Feike,

you should probably use the tag and setup rules base on tag to select entity and location.

For the user, additonal-content should work too to even override the one automatically found. It should be set as "LASTLOGGEDUSER" in HARDWARE section.


GLPI-Agent developer from Teclib' and GLPI-Network team
Previously FusionInventory-Agent maintainer

Offline

#3 2022-05-24 09:00:50

Feike
Member
Registered: 2009-02-02
Posts: 47

Re: Glpi Agent additional content

After more testing I end up making a small program in C#that will pass these data to a php script that then will check if the pc is added to glpi and then add the data to the pc.

The data is placed in a file which my small program will upload to the php script I made.

So I created a batch file with three commands:
@echo off
glpi-inventory.bat > pc.xml
glpi-injector.bat --file pc.xml --url https://glpi/front/inventory.php
glpiInventarisatie.exe

Now the inventory works just fine.

Offline

Board footer

Powered by FluxBB