Quantcast
Channel: THWACK: Message List
Viewing all articles
Browse latest Browse all 20616

Re: Looking for query/report to show switchports that have not been used since

$
0
0

I believe this sql statement should pull the information that you want, any interfaces with 0 in and out packets in more than 3 months that are not unplugged (status 4) or shutdown (status 10)

 

SELECT DISTINCT n.Caption, i.InterfaceName FROM Interfaces AS i JOIN Nodes AS n ON i.NodeID = n.NodeID JOIN InterfaceTraffic_Daily AS it ON i.InterfaceID = it.InterfaceID WHERE (it.DateTime <= DATEADD(MONTH,-3,GETDATE())) AND ((i.Status != 4) OR (i.Status != 10)) AND ((it.In_TotalPkts = 0) AND (it.Out_TotalPkts = 0)) GROUP BY n.Caption, i.InterfaceName

 

-EDIT-

although i just realized that i missed the last line of your message about what you ideally would like to see but they could be added in in the select portion


Viewing all articles
Browse latest Browse all 20616

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>