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

Unmanaged Devices don't appear in IP report #82

Open
fabriceverkor opened this issue Sep 11, 2024 · 0 comments
Open

Unmanaged Devices don't appear in IP report #82

fabriceverkor opened this issue Sep 11, 2024 · 0 comments

Comments

@fabriceverkor
Copy link

GLPI 10.0.10
IP Adressing 3.0.2
Debian bookworm

I would like to make appear in IP reports Unmanaged Devices discovered by GLPI NetDiscovery tasks, to have a complete view of used IPs in a network.
inc/addressing.class.php contains a code section dedicated to Unmanaged Devices, but $types does not contain Unmanaged.
Unmanaged Devices appear properly in report if I add Unmanaged in $types.
But debug mode shows following message.
What is wrong ?

SQL Warnings: 1052: Column 'ip' in group statement is ambiguous in query "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 glpi_ipaddresses.version LIKE 4 AND (INET_ATON(glpi_ipaddresses.name) BETWEEN '168625409' AND '168625662') AND dev.is_deleted = 0 AND dev.is_template = 0 AND ( dev.entities_id = '3' ) UNION (SELECT port.id, 'Computer' AS itemtype, port.items_id, dev.name AS dname, port.name 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_computers dev ON (port.items_id = dev.id AND port.itemtype = 'Computer') 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 glpi_ipaddresses.version LIKE 4 AND (INET_ATON(glpi_ipaddresses.name) BETWEEN '168625409' AND '168625662') AND ( dev.entities_id = '3' ) AND dev.is_deleted = '0' AND dev.is_template = '0' GROUP BY ip, port.mac ORDER BY ipnum) UNION (SELECT port.id, 'NetworkEquipment' AS itemtype, port.items_id, dev.name AS dname, port.name 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 glpi_ipaddresses.version LIKE 4 AND (INET_ATON(glpi_ipaddresses.name) BETWEEN '168625409' AND '168625662') AND ( dev.entities_id = '3' ) AND dev.is_deleted = '0' AND dev.is_template = '0' GROUP BY ip, port.mac ORDER BY ipnum) UNION (SELECT port.id, 'Peripheral' AS itemtype, port.items_id, dev.name AS dname, port.name 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_peripherals dev ON (port.items_id = dev.id AND port.itemtype = 'Peripheral') 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 glpi_ipaddresses.version LIKE 4 AND (INET_ATON(glpi_ipaddresses.name) BETWEEN '168625409' AND '168625662') AND ( dev.entities_id = '3' ) AND dev.is_deleted = '0' AND dev.is_template = '0' GROUP BY ip, port.mac ORDER BY ipnum) UNION (SELECT port.id, 'Phone' AS itemtype, port.items_id, dev.name AS dname, port.name 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_phones dev ON (port.items_id = dev.id AND port.itemtype = 'Phone') 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 glpi_ipaddresses.version LIKE 4 AND (INET_ATON(glpi_ipaddresses.name) BETWEEN '168625409' AND '168625662') AND ( dev.entities_id = '3' ) AND dev.is_deleted = '0' AND dev.is_template = '0' GROUP BY ip, port.mac ORDER BY ipnum) UNION (SELECT port.id, 'Printer' AS itemtype, port.items_id, dev.name AS dname, port.name 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_printers dev ON (port.items_id = dev.id AND port.itemtype = 'Printer') 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 glpi_ipaddresses.version LIKE 4 AND (INET_ATON(glpi_ipaddresses.name) BETWEEN '168625409' AND '168625662') AND ( dev.entities_id = '3' ) AND dev.is_deleted = '0' AND dev.is_template = '0' GROUP BY ip, port.mac ORDER BY ipnum) UNION (SELECT port.id, 'Enclosure' AS itemtype, port.items_id, dev.name AS dname, port.name AS pname, glpi_ipaddresses.name as ip, port.mac ,0 AS users_id , INET_ATON(glpi_ipaddresses.name) AS ipnum FROM glpi_networkports port LEFT JOIN glpi_enclosures dev ON (port.items_id = dev.id AND port.itemtype = 'Enclosure') 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 glpi_ipaddresses.version LIKE 4 AND (INET_ATON(glpi_ipaddresses.name) BETWEEN '168625409' AND '168625662') AND ( dev.entities_id = '3' ) AND dev.is_deleted = '0' AND dev.is_template = '0' GROUP BY ip, port.mac ORDER BY ipnum) UNION (SELECT port.id, 'PDU' AS itemtype, port.items_id, dev.name AS dname, port.name AS pname, glpi_ipaddresses.name as ip, port.mac ,0 AS users_id , INET_ATON(glpi_ipaddresses.name) AS ipnum FROM glpi_networkports port LEFT JOIN glpi_pdus dev ON (port.items_id = dev.id AND port.itemtype = 'PDU') 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 glpi_ipaddresses.version LIKE 4 AND (INET_ATON(glpi_ipaddresses.name) BETWEEN '168625409' AND '168625662') AND ( dev.entities_id = '3' ) AND dev.is_deleted = '0' AND dev.is_template = '0' GROUP BY ip, port.mac ORDER BY ipnum) UNION (SELECT port.id, 'Cluster' AS itemtype, port.items_id, dev.name AS dname, port.name AS pname, glpi_ipaddresses.name as ip, port.mac ,0 AS users_id , INET_ATON(glpi_ipaddresses.name) AS ipnum FROM glpi_networkports port LEFT JOIN glpi_clusters dev ON (port.items_id = dev.id AND port.itemtype = 'Cluster') 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 glpi_ipaddresses.version LIKE 4 AND (INET_ATON(glpi_ipaddresses.name) BETWEEN '168625409' AND '168625662') AND ( dev.entities_id = '3' ) AND dev.is_deleted = '0' GROUP BY ip, port.mac ORDER BY ipnum) UNION (SELECT port.id, 'Unmanaged' AS itemtype, port.items_id, dev.name AS dname, port.name AS pname, glpi_ipaddresses.name as ip, port.mac ,0 AS users_id , INET_ATON(glpi_ipaddresses.name) AS ipnum FROM glpi_networkports port LEFT JOIN glpi_unmanageds dev ON (port.items_id = dev.id AND port.itemtype = 'Unmanaged') 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 glpi_ipaddresses.version LIKE 4 AND (INET_ATON(glpi_ipaddresses.name) BETWEEN '168625409' AND '168625662') AND ( dev.entities_id = '3' ) AND dev.is_deleted = '0' GROUP BY ip, port.mac ORDER BY ipnum)"

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

1 participant