Team,
I need to fetch Total Port, Available & Used again Storage Switches. Could anyone have SQL queries to fetch such data from SolarWinds ?
I used below query, but not getting expected results
SELECT
NodeCaption AS [Device Name],
AgentIP AS [Device IP],
COUNT(
CASE WHEN n.Interfaces.AdminStatus = 'Up'
THEN 1 ELSE NULL END
)
AS [Admin Up],
COUNT(
CASE WHEN n.Interfaces.AdminStatus = 'Down'
THEN 2 ELSE NULL END
)
AS [Admin Down],
COUNT(
CASE WHEN n.Interfaces.OperStatus = 'UP'
THEN 1 ELSE NULL END
)
AS [Oper Up],
COUNT(
CASE WHEN n.Interfaces.OperStatus = 'Down'
THEN 2 ELSE NULL END
)
AS [Oper Down],
COUNT(
n.Interfaces.AdminStatus
)
AS [Total]
FROM
NCM.Nodes n
WHERE
n.Interfaces.PhysicalInterface = 'Y'
GROUP BY
NodeCaption, AgentIP
ORDER BY
NodeCaption