You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)"
The text was updated successfully, but these errors were encountered:
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 FROMglpi_networkports
port LEFT JOINglpi_networkequipments
dev ON (port
.items_id
=dev
.id
ANDport
.itemtype
= 'NetworkEquipment') LEFT JOINglpi_networknames
ON (port
.id
=glpi_networknames
.items_id
) LEFT JOINglpi_ipaddresses
ON (glpi_ipaddresses
.items_id
=glpi_networknames
.id
) WHERE (glpi_ipaddresses
.name
IS NOT NULL ANDglpi_ipaddresses
.name
!= '') ANDglpi_ipaddresses
.version
LIKE 4 AND (INET_ATON(glpi_ipaddresses
.name
) BETWEEN '168625409' AND '168625662') ANDdev
.is_deleted
= 0 ANDdev
.is_template
= 0 AND (dev
.entities_id
= '3' ) UNION (SELECTport
.id
, 'Computer' ASitemtype
,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 FROMglpi_networkports
port LEFT JOINglpi_computers
dev ON (port
.items_id
=dev
.id
ANDport
.itemtype
= 'Computer') LEFT JOINglpi_networknames
ON (port
.id
=glpi_networknames
.items_id
) LEFT JOINglpi_ipaddresses
ON (glpi_ipaddresses
.items_id
=glpi_networknames
.id
) WHERE (glpi_ipaddresses
.name
IS NOT NULL ANDglpi_ipaddresses
.name
!= '') ANDglpi_ipaddresses
.version
LIKE 4 AND (INET_ATON(glpi_ipaddresses
.name
) BETWEEN '168625409' AND '168625662') AND (dev
.entities_id
= '3' ) ANDdev
.is_deleted
= '0' ANDdev
.is_template
= '0' GROUP BYip
,port
.mac
ORDER BY ipnum) UNION (SELECTport
.id
, 'NetworkEquipment' ASitemtype
,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 FROMglpi_networkports
port LEFT JOINglpi_networkequipments
dev ON (port
.items_id
=dev
.id
ANDport
.itemtype
= 'NetworkEquipment') LEFT JOINglpi_networknames
ON (port
.id
=glpi_networknames
.items_id
) LEFT JOINglpi_ipaddresses
ON (glpi_ipaddresses
.items_id
=glpi_networknames
.id
) WHERE (glpi_ipaddresses
.name
IS NOT NULL ANDglpi_ipaddresses
.name
!= '') ANDglpi_ipaddresses
.version
LIKE 4 AND (INET_ATON(glpi_ipaddresses
.name
) BETWEEN '168625409' AND '168625662') AND (dev
.entities_id
= '3' ) ANDdev
.is_deleted
= '0' ANDdev
.is_template
= '0' GROUP BYip
,port
.mac
ORDER BY ipnum) UNION (SELECTport
.id
, 'Peripheral' ASitemtype
,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 FROMglpi_networkports
port LEFT JOINglpi_peripherals
dev ON (port
.items_id
=dev
.id
ANDport
.itemtype
= 'Peripheral') LEFT JOINglpi_networknames
ON (port
.id
=glpi_networknames
.items_id
) LEFT JOINglpi_ipaddresses
ON (glpi_ipaddresses
.items_id
=glpi_networknames
.id
) WHERE (glpi_ipaddresses
.name
IS NOT NULL ANDglpi_ipaddresses
.name
!= '') ANDglpi_ipaddresses
.version
LIKE 4 AND (INET_ATON(glpi_ipaddresses
.name
) BETWEEN '168625409' AND '168625662') AND (dev
.entities_id
= '3' ) ANDdev
.is_deleted
= '0' ANDdev
.is_template
= '0' GROUP BYip
,port
.mac
ORDER BY ipnum) UNION (SELECTport
.id
, 'Phone' ASitemtype
,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 FROMglpi_networkports
port LEFT JOINglpi_phones
dev ON (port
.items_id
=dev
.id
ANDport
.itemtype
= 'Phone') LEFT JOINglpi_networknames
ON (port
.id
=glpi_networknames
.items_id
) LEFT JOINglpi_ipaddresses
ON (glpi_ipaddresses
.items_id
=glpi_networknames
.id
) WHERE (glpi_ipaddresses
.name
IS NOT NULL ANDglpi_ipaddresses
.name
!= '') ANDglpi_ipaddresses
.version
LIKE 4 AND (INET_ATON(glpi_ipaddresses
.name
) BETWEEN '168625409' AND '168625662') AND (dev
.entities_id
= '3' ) ANDdev
.is_deleted
= '0' ANDdev
.is_template
= '0' GROUP BYip
,port
.mac
ORDER BY ipnum) UNION (SELECTport
.id
, 'Printer' ASitemtype
,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 FROMglpi_networkports
port LEFT JOINglpi_printers
dev ON (port
.items_id
=dev
.id
ANDport
.itemtype
= 'Printer') LEFT JOINglpi_networknames
ON (port
.id
=glpi_networknames
.items_id
) LEFT JOINglpi_ipaddresses
ON (glpi_ipaddresses
.items_id
=glpi_networknames
.id
) WHERE (glpi_ipaddresses
.name
IS NOT NULL ANDglpi_ipaddresses
.name
!= '') ANDglpi_ipaddresses
.version
LIKE 4 AND (INET_ATON(glpi_ipaddresses
.name
) BETWEEN '168625409' AND '168625662') AND (dev
.entities_id
= '3' ) ANDdev
.is_deleted
= '0' ANDdev
.is_template
= '0' GROUP BYip
,port
.mac
ORDER BY ipnum) UNION (SELECTport
.id
, 'Enclosure' ASitemtype
,port
.items_id
,dev
.name
AS dname,port
.name
AS pname,glpi_ipaddresses
.name
as ip,port
.mac
,0 ASusers_id
, INET_ATON(glpi_ipaddresses
.name
) AS ipnum FROMglpi_networkports
port LEFT JOINglpi_enclosures
dev ON (port
.items_id
=dev
.id
ANDport
.itemtype
= 'Enclosure') LEFT JOINglpi_networknames
ON (port
.id
=glpi_networknames
.items_id
) LEFT JOINglpi_ipaddresses
ON (glpi_ipaddresses
.items_id
=glpi_networknames
.id
) WHERE (glpi_ipaddresses
.name
IS NOT NULL ANDglpi_ipaddresses
.name
!= '') ANDglpi_ipaddresses
.version
LIKE 4 AND (INET_ATON(glpi_ipaddresses
.name
) BETWEEN '168625409' AND '168625662') AND (dev
.entities_id
= '3' ) ANDdev
.is_deleted
= '0' ANDdev
.is_template
= '0' GROUP BYip
,port
.mac
ORDER BY ipnum) UNION (SELECTport
.id
, 'PDU' ASitemtype
,port
.items_id
,dev
.name
AS dname,port
.name
AS pname,glpi_ipaddresses
.name
as ip,port
.mac
,0 ASusers_id
, INET_ATON(glpi_ipaddresses
.name
) AS ipnum FROMglpi_networkports
port LEFT JOINglpi_pdus
dev ON (port
.items_id
=dev
.id
ANDport
.itemtype
= 'PDU') LEFT JOINglpi_networknames
ON (port
.id
=glpi_networknames
.items_id
) LEFT JOINglpi_ipaddresses
ON (glpi_ipaddresses
.items_id
=glpi_networknames
.id
) WHERE (glpi_ipaddresses
.name
IS NOT NULL ANDglpi_ipaddresses
.name
!= '') ANDglpi_ipaddresses
.version
LIKE 4 AND (INET_ATON(glpi_ipaddresses
.name
) BETWEEN '168625409' AND '168625662') AND (dev
.entities_id
= '3' ) ANDdev
.is_deleted
= '0' ANDdev
.is_template
= '0' GROUP BYip
,port
.mac
ORDER BY ipnum) UNION (SELECTport
.id
, 'Cluster' ASitemtype
,port
.items_id
,dev
.name
AS dname,port
.name
AS pname,glpi_ipaddresses
.name
as ip,port
.mac
,0 ASusers_id
, INET_ATON(glpi_ipaddresses
.name
) AS ipnum FROMglpi_networkports
port LEFT JOINglpi_clusters
dev ON (port
.items_id
=dev
.id
ANDport
.itemtype
= 'Cluster') LEFT JOINglpi_networknames
ON (port
.id
=glpi_networknames
.items_id
) LEFT JOINglpi_ipaddresses
ON (glpi_ipaddresses
.items_id
=glpi_networknames
.id
) WHERE (glpi_ipaddresses
.name
IS NOT NULL ANDglpi_ipaddresses
.name
!= '') ANDglpi_ipaddresses
.version
LIKE 4 AND (INET_ATON(glpi_ipaddresses
.name
) BETWEEN '168625409' AND '168625662') AND (dev
.entities_id
= '3' ) ANDdev
.is_deleted
= '0' GROUP BYip
,port
.mac
ORDER BY ipnum) UNION (SELECTport
.id
, 'Unmanaged' ASitemtype
,port
.items_id
,dev
.name
AS dname,port
.name
AS pname,glpi_ipaddresses
.name
as ip,port
.mac
,0 ASusers_id
, INET_ATON(glpi_ipaddresses
.name
) AS ipnum FROMglpi_networkports
port LEFT JOINglpi_unmanageds
dev ON (port
.items_id
=dev
.id
ANDport
.itemtype
= 'Unmanaged') LEFT JOINglpi_networknames
ON (port
.id
=glpi_networknames
.items_id
) LEFT JOINglpi_ipaddresses
ON (glpi_ipaddresses
.items_id
=glpi_networknames
.id
) WHERE (glpi_ipaddresses
.name
IS NOT NULL ANDglpi_ipaddresses
.name
!= '') ANDglpi_ipaddresses
.version
LIKE 4 AND (INET_ATON(glpi_ipaddresses
.name
) BETWEEN '168625409' AND '168625662') AND (dev
.entities_id
= '3' ) ANDdev
.is_deleted
= '0' GROUP BYip
,port
.mac
ORDER BY ipnum)"The text was updated successfully, but these errors were encountered: