akm77 / ldapcomputers

LDAP computers - GLPI plugin
GNU General Public License v3.0
7 stars 6 forks source link

Insertion into Computer #5

Open EC2311 opened 4 years ago

EC2311 commented 4 years ago

Hello

We can see the computers not present in GLPI : OK why not an insertion action into 'computer' table ?

akm77 commented 4 years ago

This is because I did create this tool for quick find computers with unworking for some reasons FusionInventory agent. It may be GPO error, or deployment error. But now I can see, based on twoo fields: FusionInventury: Last inventory and Ldapcomputers: Last logon, that computer alive (Lastlogon up today), FusionInventory agent (FusionInventury: Last inventory out of date). And at last I can import into GLPI computers only computer name. It is too few to be usefull.

EC2311 commented 4 years ago

As for me, we have os version in the ldap. and we use the computer name for linking those to applications, Project and so on. so only the name and os are already useful rather than nothing...

akm77 commented 4 years ago

OK I understood I did not have such task I think that this is possible but it will take time

EC2311 commented 4 years ago

Ok Thanks

EC2311 commented 4 years ago

Just a remark : In AD, we see description, and this field must be interesting to see (like the version of computer for instance), and of course to import after.

akm77 commented 4 years ago

Of cause But description not mandatory. It may be filled, may be empty. Unlike name, DN, guid and so on

EC2311 commented 4 years ago

when managing more of one AD -> this AD is not in the field we can choose on the page of discovered computers.

akm77 commented 4 years ago

You're right. It subject for further development.

EC2311 commented 4 years ago

First request to insert computer : insert into glpi_computers (autoupdatesystems_id, name, uuid, date_creation) SELECT (SELECT c.id FROM glpi_autoupdatesystems c WHERE c.name = 'LDAP') , b.name, b.objectguid, now() FROM glpi_plugin_ldapcomputers_computers b WHERE b.is_in_glpi_computers = 0 and b.name not in (select name from glpi_computers where is_deleted = 0) Second request to insert OS linked to Computer : insert into glpi_items_operatingsystems (itemtype, items_id, operatingsystems_id, operatingsystemversions_id) select 'Computer', (select a.id from glpi_computers a where a.is_deleted = 0 and a.name = b.name), (SELECT id FROM glpi_operatingsystems a WHERE a.name = b.operatingsystem ) , (SELECT id FROM glpi_operatingsystemversions WHERE name = CONCAT( SUBSTRING( operatingSystemVersion, 1, LOCATE( '(', operatingSystemVersion ) -2 ) , '.', SUBSTRING( operatingsystemversion, LOCATE( '(', operatingSystemVersion ) +1, LOCATE( ')', operatingSystemVersion ) - LOCATE( '(', operatingSystemVersion ) -1 ) ) ) FROM glpi_plugin_ldapcomputers_computers b WHERE b.is_in_glpi_computers =0

EC2311 commented 3 years ago

Hello

Any feedback on this issue ? evolution ?