Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Request - Enhancement - use flag to bypass AssetTag <> Inventory Number import #46

Open
inext68 opened this issue Jun 20, 2024 · 8 comments

Comments

@inext68
Copy link

inext68 commented Jun 20, 2024

Thanks for you job.
Using the agent with 10Zig thinclient we have these data for BIOS (see below).
The problem is that importing data in GLPI the value overwrite the value in the field "Inventory number".
This appen first time we launch the agent.
If we change manually the value imported from agent in GLPI the import will be locked by "lock system" of GLPI.

Having hundreds o thinclient we have to change the info manually for everyone after first import.

Is possibile modifiy the code to set a flag to enable or disable the import for field?
Below an example of the inventory generated from agent.
Thank you

############
<BIOS>
           <ASSETTAG>Chassis Asset Tag</ASSETTAG>
            <BDATE>09/23/2019</BDATE>
            <BMANUFACTURER>INSYDE Corp.</BMANUFACTURER>
            <BVERSION>V:3.4.21-08082019</BVERSION>
            <MMANUFACTURER>Type2 - Board Manufacturer</MMANUFACTURER>
            <MSN>Type2 - Board Serial Number</MSN>
            <SMANUFACTURER>10ZiG Technology</SMANUFACTURER>
           <SMODEL>4500</SMODEL>
           <SSN>xxxxxxxxxxxx</SSN>
           <TYPE>Notebook</TYPE>    
</BIOS> 
@jackburton79
Copy link
Owner

Hi, thanks for reporting!
Will have a look next week.

@jackburton79
Copy link
Owner

I had a look at what glpi agent does:

--assetname-support=1|2        [unix/linux only] set the asset name depending on the given value:
                                        - 1 (the default), the short hostname is used as asset name
                                        - 2, the as-is hostname (can be fqdn) is used as asset name

As default behaviour it uses the hostname as asset tag.
Would it be okay if this agent did the same ?

@inext68
Copy link
Author

inext68 commented Jun 28, 2024

I believe these behaviour is set in glpi-agent to retrieve the hostname that can be short or FQDN. Normally that info is filled into

<HARDWARE> <NAME>asset-name</NAME> ... <HARDWARE>

The asset tag is from
<BIOS> <ASSETTAG>asset-tag</ASSETTAG> ... <BIOS>

The value ASSETTAG is read by dmidecode and is a readonly value from bios in the section "chassis information > Asset Tag" and is used to fill the inventory number field in GLPI

We use the inventory number field with an internal Barcode number that is different by hostname.

If not possibile to bypass the import than is better to choose a hostname value for import.

thanks

@jackburton79
Copy link
Owner

Hi,
I'm checking against official glpi agent and they behaves the same. Do you know if in the glpi agent is it possible to skip the asset tag ?

@inext68
Copy link
Author

inext68 commented Jul 1, 2024

Hi,
the only way that I know to bypass inventory number import is is present a lock on the field.
But this lock is created when the content of the filed is manually modified after an automatic import.

Then our value are not imported by agent but manually filled in and than the fiels are not locked for change.
In the official glpi-agent i believe the assets-tag I have to test if it us exported the Asset-Tag or if only the Asset-name
I'll check in the same hardware with the official agent and report to you

@inext68
Copy link
Author

inext68 commented Jul 4, 2024

Hi,
I have start a remoteinventory from glpi-agent to the thinclient and after 1hour the result is that also glpi-agent import "Chassis Asset Tag" as inventory number.

If is possibile I would try to fork you code to bypass this field.
Can you tell me where is the function that you use to fill the Asset-name?
Thank a lot

@jackburton79
Copy link
Owner

Hi,
with "asset-name" you mean the computer name ?

@inext68
Copy link
Author

inext68 commented Jul 31, 2024 via email

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants