Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Generic Objects Plugin #55

Open
sylvietto opened this issue May 18, 2022 · 11 comments
Open

Generic Objects Plugin #55

sylvietto opened this issue May 18, 2022 · 11 comments

Comments

@sylvietto
Copy link

Is it possible to include items created by the Generic Objects plugin with an assigned IP address, please?

@Zilber00
Copy link

+1

@zorkyx
Copy link

zorkyx commented Feb 21, 2023

Hi,

You can add your generic object at line 41 of glpi/marketplace/addressing/inc/addressing.class.php

And an exeption near line 568 :
if ($type == 'PluginFusioninventoryUnknownDevice'
|| $type == 'Enclosure'
|| $type == 'PDU'

@sylvietto
Copy link
Author

Good morning, zorkyx.
Thank you for your reply.
My generic object is labeled "Elettromedicali" and the external id is "elettromedicali".
The itemtype shoud be PluginGenericobjectElettromedicali so I added this value near line 41 in addressing.class.php.

static $types = ['Computer', 'NetworkEquipment', 'Peripheral', 'Phone', 'Printer', 'Enclosure', 'PDU', 'Cluster', 'PluginGenericobjectElettromedicali'];

and an exception near line 568:

 if ($type == 'PluginFusioninventoryUnknownDevice'
             || $type == 'Enclosure'
             || $type == 'PDU'
             || $type == 'Cluster'
             || $type == 'Unmanaged'
             || $type == 'PluginGenericobjectElettromedicali')


Still no luck.

@zorkyx
Copy link

zorkyx commented Feb 22, 2023

Do you have an error or other ?

@sylvietto
Copy link
Author

No errors.
Simply, there are no "Elettromedicali" in the list.

@zorkyx
Copy link

zorkyx commented Feb 23, 2023

Can you execute this MySQL request :
SELECT * FROM glpi_plugin_genericobject_types WHERE 1;

@sylvietto
Copy link
Author

The result of the query is:

3 | 0 | PluginGenericobjectElettromedicali | 1 | elettromedicali |   | 2019-10-02 12:13:21 | 2019-09-23 16:20:32 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | NULL | 0 | 1 | 0 | 0 | 0 | NULL

@zorkyx
Copy link

zorkyx commented Feb 24, 2023

OK, "PluginGenericobjectElettromedicali" is the good name ;)

Can you try a search in the plugin with the "active debug mode". Click on Ajax Debug at the bottom of the page and "SQL Request" tab and search the biggest request like :

"SELECT port.id, 'NetworkEquipment' AS itemtype, dev.id AS on_device, dev.name AS dname, '' AS pname, glpi_ipaddresses.name as ip, port.mac, dev.users_id, INET_ATON(glpi_ipaddresses.name) AS ipnum
FROM glpi_networkports port
LEFT JOIN glpi_networkequipments dev ON (port.items_id = dev.id AND port.itemtype = 'NetworkEquipment')
LEFT JOIN glpi_networknames ON (port.id = glpi_networknames.items_id)
LEFT JOIN glpi_ipaddresses ON (glpi_ipaddresses.items_id = glpi_networknames.id)
WHERE (glpi_ipaddresses.name IS NOT NULL AND glpi_ipaddresses.name != '') AND `g ..................
"

Search in the Unions, a select with : port.itemtype` = ''PluginGenericobjectElettromedicali"

If not, the request don't search in you plugin.

@sylvietto
Copy link
Author

Good morning Zorkyx.

Thank you for your interest.
With the help of your advices, I think I understand what the problem is.
There are several entities configured in my GLPI; the objects of the type "PluginGenericobjectElettromedicali" belongs to a subentity, while the reports of the plugin IPAddressing belong to the father entity.
The reports generated by the plugin IPAddressing does not include objects belonging to subentities.

I don't know if there is a way to fix the issue...

Thank you very much.

@zorkyx
Copy link

zorkyx commented Mar 2, 2023

Indeed, the reports are provided by entity and there is no option to select entity and children :'(
On the other hand, it is possible to make reports by entity.
In my case, the entities are isolated so it's not a problem for me.
I don't know if it is possible to fix this issue, sorry.

@sylvietto
Copy link
Author

Good morning, zorkyx.

Your help has been much appreciated and useful to understand the issue. I have removed all the entities, merging objects into the root one and now I can see a complete IP report.
I leave this issue opened in order to see if it will be managed with future updates.

Goodbye.

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

No branches or pull requests

3 participants