Question regarding Device Import, notably for phones, printers, and generic network objects #456
cdp1337
started this conversation in
Ideas and feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
The generic Network Equipment support setting types such as 'Phone' or 'Printer'. Is the desired approach for GLPI with 11+ to use these generic Network Equipment objects or the specialty objects for the various types of devices to inventory?
Asking because I have a passive network scanner that can feed into GLPI for devices which do not otherwise support agents, (notably printers, phones, or appliances).
Example payload:
{ "deviceid": "grandstr-c074ad25c762-network-diagnostics", "itemtype": "Phone", "action": "inventory", "content": { "versionclient": "GLPI-Agent_v1.18-1_NetworkDiagnostics-Discover", "hardware": { "name": "192.168.0.192", "chassis_type": "Phone", "defaultgateway": "192.168.0.1", "serial": "C074AD25C762", "model": "GXP1782", "manufacturer": "Grandstream Networks, Inc." }, "firmwares": [{"version": "1.0.1.106", "type": "Firmware", "manufacturer": "Grandstream Networks, Inc."}], "network_ports": [{"ifalias": "network", "mac": "C0:74:AD:25:C7:62", "ips": ["192.168.0.192"], "ifnumber": 0}], "network_device": { "mac": "C0:74:AD:25:C7:62", "name": "192.168.0.192", "type": "Phone", "serial": "C074AD25C762", "model": "GXP1782", "manufacturer": "Grandstream Networks, Inc." } }, "tag": "Test" }Schema generated via my custom Python network scanner and formatted to the best of my understanding of https://github.com/glpi-project/inventory_format/blob/main/inventory.schema.json
This import data works fine when the
itemtypeis set to the generic NetworkEquipment, but fails on multiple fronts due to src/Glpi/Inventory/MainAsset/Phone.php not containing the necessary logic required forprepare, (and entirely missing that method altogether).SO, are these type-specific classes being deprecated in favour of the generic NetworkEquipment or is its lack of functionality simply an oversight due to not being implemented yet?
I can easily add and test the necessary logic within this, and other network-based devices, and publish for contribution within the upstream project, but if these files are unsupported and on the way out, doing so would be a waste if they are only going to be removed in a future release anyway.
All reactions