Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

No link between device and domain #3162

Closed
MLOcc opened this issue Apr 30, 2021 · 16 comments
Closed

No link between device and domain #3162

MLOcc opened this issue Apr 30, 2021 · 16 comments
Assignees
Milestone

Comments

@MLOcc
Copy link

MLOcc commented Apr 30, 2021

Hi,
Since Glpi 9.5, domains are no longer set in computer tab but linked with computer in domains tab.

in glpi 9.4.6
image

Fusion Inventory still creates new domains on Glpi 9.5 and +
image

but no link is done with device
image
image
image

tested on
image
and
image
and
image

with Fusion Inventory Agent 2.6

Is it the right way it's supposed to work ?

Best regards

@artmoni
Copy link

artmoni commented May 5, 2021

Hi, we have same pbm on GLPI 9.5.4 with fusion inventory 9.5+3.0,

Workgroup is present on inventory and created in domain list but not associated in glpi_domains_items, if linked manually, that works but we need the inventory to associate current domain to computer.

@WebGregGit
Copy link

Same

@dzogrim
Copy link

dzogrim commented May 27, 2021

Hello there!

Yep… the same is confirmed here running FusionInventory 9.5.0+1.0 on GLPi 9.5.4.
Since recent updates of GLPi changes a lot the domains management, it's broken all over domain objects.

And it's the same behavior from the agent (v2.5.2-1) or even the manual import of generated XML (containing domain information).
We have to proceed manually each time to a domain link for a new computer.
Manual changes in GLPi are successful to link a computer to one (or more) domains.

Maybe the data should be imported elsewhere, since GLPi databases have considerably changed.

Thanks in advance,

Regards,

Seb

@dzogrim
Copy link

dzogrim commented Jul 22, 2021

Hello… any news about this please? Thanks a lot!

@FI5CHER
Copy link

FI5CHER commented Aug 3, 2021

As a "workaround" i extract the domain from the xml file and put this directly in the table.

mysql example:
insert into glpi_domains_items ( domains_id, items_id, itemtype) values ( 1, 3810, 'Computer' );

( background: i do have a python script extracting all running processes , so this script just runs this insert automatically ... so i check is the domain available ... if not insert ... )

@MLOcc
Copy link
Author

MLOcc commented Aug 5, 2021

Thank you @FI5CHER
I spent many hours peeling the source code of the plugin but I don't found where to modify it to add the relation between domain and computer.

With the "workaround" you share, I made one in php that recursively read each xml file (computerid.xml) from files/_plugins/fusioninventory/xml/computer and extract domain name with regexp /<DNS\_DOMAIN>(.+)<\/DNS\_DOMAIN>/
If no link exists between domain and computer in glpi_domains_items table, the script inserts it, if link exists but domain in xml file is different, the script updates it.

I hope someone propose a PR to have it in native plugin

@FLD83
Copy link

FLD83 commented Sep 10, 2021

Hi,

After some search, i have found that domains_id are always inject into the tables glpi_computers ( i have add the field into the table).
image

But for associate Computer to Domain we have to insert it on glpi_domains_items with items id.
Where we could modify this ??
Some change has be made on code of fusioninventory plugins to change this but it still injected on same place.
@ddurieux could you see this please ?

@ddurieux ddurieux self-assigned this Jan 21, 2022
@ddurieux ddurieux added the bug label Jan 21, 2022
@ddurieux ddurieux added this to the 9.5+3.1 milestone Mar 22, 2022
@EC2311
Copy link

EC2311 commented Mar 28, 2022

Hello

I confim with 9.5.5 and 3.0, the same problem

thanks

@ddurieux
Copy link
Member

Fix planned wednesday

@EC2311
Copy link

EC2311 commented Mar 28, 2022

great @ddurieux
thanks

@ddurieux
Copy link
Member

I'm coding it, but for information, the new domain system is not automatic inventory compliant. A part has not been added in GLPI, so you will not be able to manage them manually AND automatic with FusionInventory.

@EC2311
Copy link

EC2311 commented Mar 31, 2022

is there a way in those lines (in inventorycomputerinventory.class.php)
image

adding a sql create (only if domain_id is filled)
insert into glpi_domains_items (items_id, itemtype, domains_id) value($ordi,'computer',$input['domains_id']);

but I don't know where finding $ordi :(

@FLD83
Copy link

FLD83 commented Mar 31, 2022

Domains_id field in item computer has been remove in glpi database, it's need to be recreate before

@ddurieux
Copy link
Member

The code is ready but not pushed, be cause think about how to manage it.
Like the automatic inventory not managed with domains (yes it's very bad), I will add an option in general config of the plugin to inventory or not the domains, and will be disabled by default.

The main problem is that you wil not be able to manage domains manually and automatically (with fusioninventory). it's only manually of only automatic, but not both like you can have on softwares or others (it's a GLPI limitation)

@EC2311
Copy link

EC2311 commented Mar 31, 2022

@ddurieux je ne comprends pas :
de mon cote $input['domains_id'] contient le nom du domaine.
et en creant (insert) l'enregistreement dans :
insert into glpi_domains_items(domains_id, items_id, itemtype)
values(select id from glpi_domains where name = '$domains_id', (select id from glpi_computers where name = '$input['computer']['name']' where is_deleted = 0 and is_template = 0) ,'computer')
je retrouve bien le lien ordi/domain (je n'ai pas trouvé l'endroit de l'id du computer...)
mais peut etre je suis completement a cote de la plaque....?

@ddurieux
Copy link
Member

C'est le items_id

Comme je le disais, le patch est prêt déjà (+ les tests), il faut que je rajoute l'activation dans la config. Ca sera prêt d'ici fin de semaine.

@ddurieux ddurieux added improvement and removed bug labels Apr 2, 2022
ddurieux added a commit that referenced this issue Apr 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants