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: