Quantcast
Channel: THWACK: Message List - Network Configuration Manager
Viewing all articles
Browse latest Browse all 8827

Re: Port count report

$
0
0

Here is a SQL query to identify total, used and available physical ports. You can modify the WHERE (InterfaceTypeDescription like '%ethernet%') statement to include whatever interface type you need to report on.

 

SELECT NodeID, Caption,

COUNT (*) AS "Total Ports", SUM (IsUp) AS "Used Ports", SUM (IsDown) AS "Available Ports"

FROM (

SELECT ND.Caption, ND.NodeID,

CASE WHEN OperStatus = 'Up' THEN 1 ELSE 0 END AS IsUp,

CASE WHEN OperStatus = 'Down' THEN 1 ELSE 0 END AS IsDown

FROM NCM_Interfaces NCMI INNER JOIN NCM_NodeProperties NCMNP ON (NCMI.NodeID = NCMNP.NodeID)

INNER JOIN NodesData ND ON (NCMNP.CoreNodeID = ND.NodeID)

WHERE (InterfaceTypeDescription  like '%ethernet%')

) T1

GROUP BY NodeID, Caption

ORDER BY Caption DESC

 

The output looks like:

 

Port report.JPG


Viewing all articles
Browse latest Browse all 8827

Trending Articles



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