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 2024-04-16 16:35:38

eduardomozart
Member
Registered: 2020-10-13
Posts: 7

GLPI Agent custom module view on GLPI

Hello,
I would like to develop a plugin or module to parse additional content like the AIX Oracle database available at FusionInventory documentation at:

hxxps://documentation.fusioninventory.org/FusionInventory_agent/advanced/additional_content/

But the file "formatconvert.class.php" doesn't seems to exist anymore.

It would be great if there was some kind of "foo" plugin and GLPI Agent module or documentation article that shows how to implement custom content using GLPI Agent. I know it's possible to use Additional Content with GLPI Agent, but I only could found how to add elements to Inventory task, not how to implement new types of data (e.g. Oracle AIX DB).

My intention would be to deploy the CPU and memory usage of switches similar to FusionInventory Agent 9.5. I already created the module on GLPI Agent at hxxps://github.com/eduardomozart/ScriptUtil/tree/master/Scripts/GLPI/Agent/SNMP and it works on FusionInventory plug-in (GLPI 9.5) but I would like to reimplement those fields (CPU, RAM) for networkequipments object types and have them stored on DB so I could query them and recreate this tab.

Offline

#2 2024-04-16 18:23:22

eduardomozart
Member
Registered: 2020-10-13
Posts: 7

Re: GLPI Agent custom module view on GLPI

I'd figured it out on my own. For existing keys (e.g. "MEMORY" on NetworkEquipment devices) you only need to create the column name on "glpi_networkequipments" GLPI DB table that it will automatically fill that column with the inventory value. For non-existing keys (e.g. "XXX" on NetworkEquipment devices), you need to add the parameter name to the JSON scheme on "/vendor/glpi-project/inventory_format/inventory.schema.json" relative to GLPI webserver file location (otherwise you'll receive a "[error] #3, [http client] communication error: 500 Internal Server Error, Array, (,     [0] => JSON does not validate. Violations:, Additional properties not allowed: XXX at #->properties:content->properties:network_device, )" message error on GLPI Agent log) and create the column with the same parameter name (XXX) to the "glpi_networkequipments" GLPI DB table (and of course, create a module that will fill info to that parameter, you can find an example here: hxxps://github.com/glpi-project/glpi-agent/tree/develop/lib/GLPI/Agent/SNMP and on hxxps://github.com/glpi-project/glpi-agent/tree/develop/lib/GLPI/Agent/SNMP/MibSupport). I'm not sure if it's possible to change the schema without editing this file, it would be great as it would allow custom plugins/methods be developed to inventory more assets/info types.

Last edited by eduardomozart (2024-04-16 18:34:32)

Offline

Board footer

Powered by FluxBB