From ef2ab9b6b4e4577be32f3386ac0f22af7ce2b5e7 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Mon, 27 Nov 2023 21:23:54 +0000 Subject: [PATCH] #920 orphan vlans report --- share/config.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/share/config.yml b/share/config.yml index 53dc6ac1..b84d4a1f 100644 --- a/share/config.yml +++ b/share/config.yml @@ -242,6 +242,20 @@ system_reports: FROM device WHERE creation > (LOCALTIMESTAMP - COALESCE(NULLIF(?,''), '2 months')::interval) ORDER BY creation DESC + - tag: vlansonlyuplinks + category: VLAN + label: 'VLANs Only On Uplinks' + columns: + - { ip: 'Device IP', _searchable: true } + - { vlans: 'VLAN List' } + query: | + SELECT ip, array_to_string(array_agg(DISTINCT vlan::integer ORDER BY vlan::integer ASC), ', ') AS vlans + FROM device_port_vlan + WHERE native IS false + AND vlan NOT IN + (SELECT vlan FROM device_port_vlan WHERE native IS true) + GROUP BY ip + ORDER BY ip table_pagesize: 10 table_showrecordsmenu: - [10, 25, 50, 100, '-1']