Repository navigation
Enter the product number for a computer model during an inventory #531
Replies: 1 comment
|
Hello, I would also like to express my strong support for this feature request, which I believe would be particularly valuable for improving IT asset inventory management and automation in GLPI. It is unfortunate that the product number (SKU), already correctly collected by GLPI Agent, is not automatically used to populate the corresponding field in computer models. In environments managing large IT fleets, manually entering this information creates unnecessary administrative overhead that could easily be avoided. This improvement would bring several benefits:
Having this functionality integrated directly into GLPI's native inventory system would be much more beneficial than relying on an additional plugin or custom development that requires ongoing maintenance. It would also be important to ensure that existing product numbers are not overwritten and to consider situations where different SKUs may share the same computer model name. The proposed proof of concept demonstrates that a technical solution is feasible and provides an excellent starting point for an official implementation. I sincerely hope this enhancement will be considered and included in a future GLPI release. Thank you to the author for this detailed proposal and to the GLPI development team for their continued work! |
Uh oh!
There was an error while loading. Please reload this page.
Hello,
To function, the Manufacturer Import plugin (which imports warranty dates from the manufacturer’s website) requires the manufacturer’s name, the serial number, and—for certain models, such as some HP computers—it also requires the product number (SKU) associated with the inventoried hardware model. However, this information is not taken into account in GLPI, even though it is correctly reported by the GLPI-Agent.
Example of an XML file (partial) reported by the inventory agent in the BIOS section
Here's another example using a JSON file (excerpt):
However, the “Product Number” field does exist on the “Computer Model” page (under the “Titles” menu > ‘Models’ > “Computer Models”). The GLPI inventory module could easily populate this value automatically.
To do so, here is a flowchart that works:
Here is the code inserted into two PHP files located in a plugin folder named “skunumber” (tested on GLPI 11.0.11 and GLPI 12.0.0):
setup.php
hook.php
This process is applied here to HP hardware, but it may also be applicable to other hardware that uses a model number (SKU).
I want to clarify that I did not write this code; I simply copied the diagram and the PHP code provided by a colleague. I am not a developer, so I cannot take responsibility for maintaining it. However, I am reaching out to the GLPI developers to see if it would be possible to expand and integrate this feature into the native inventory section of a future version of GLPI. That would be greatly appreciated.
Best regards.
(note: this text is translated from french by DeepL Translator. The original text is published in the french “GLPI Native Inventory” category of the GLPI-project forum: Renseigner le n° de produit d’un modèle d’ordinateur HP (avec code PHP)).
All reactions