From f0b41f582a04101fa2aa4f99c27134492103572a Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sat, 2 Dec 2023 10:37:55 +0000 Subject: [PATCH] #1023 ports with most vlans report --- share/config.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/share/config.yml b/share/config.yml index 314f8f5d..58a2bd70 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: portswithmostvlans + category: Port + label: 'Ports with the most VLANs' + columns: + - { ip: 'Device IP', _searchable: true } + - { port: 'Port' } + - { vlans: 'VLAN Count' } + bind_params: ['threshold'] + query: | + SELECT ip, port, count(vlan) AS vlans + FROM device_port_vlan + GROUP BY ip, port + HAVING count(vlan) > COALESCE(NULLIF(?,''), '1') ::integer + ORDER BY vlans DESC, ip ASC, port ASC - tag: vlansonlyuplinks category: VLAN label: 'VLANs Only On Uplinks'