Hi,
We would like to obtain the Top 5 Applications data via the SolarWinds API.
Note we want the actual data and not to embed the SolarWinds widget in our user interface.
Please can you assist.
Regards,
Andrew
What version of NTA are you running?
I believe we are using NTA 4.1.1
The following query gives you the TOP 5 applications for the last hour last hour based on total bytes.
SELECT TOP 5 Flows.Application.Name, Flows.Application.PortName, SUM(TotalBytes) AS TotalBytes, SUM(TotalPackets) AS TotalPacketsFROM Orion.Netflow.FlowsWHERE Flows.ProtocolID IN (6, 17) AND Flows.ObservationTimeStamp > AddHour(-1, GETUTCDATE())GROUP BY Flows.Node.NodeID, Flows.ApplicationId, Flows.Application.Name, Flows.Application.PortNameORDER BY TotalBytes DESC
Thanks for that.
Unfortunately when I try to run that query in SWQL Studio I get a timeout:
This seems to happen even when running the most basic of queries against the Orion.Netflow.Flows table.
Any ideas what could be causing this issue?
The problem may be the use of the "ADDHOUR" function. See the note at the bottom of this page: NTA 4.0 Entity Model · solarwinds/OrionSDK Wiki · GitHub
Try doing the date math using + and - fractional days instead of the functions. Like this:
WHERE Flows.ObservationTimestamp > GETUTCDATE() - 0.417
Unfortunately that hasn't made any difference. The following query incorporating your suggestion still times out after 2 minutes:
SELECT TOP 5 Flows.Application.Name, Flows.Application.PortName, SUM(TotalBytes) AS TotalBytes, SUM(TotalPackets) AS TotalPackets
FROM Orion.Netflow.Flows
WHERE Flows.ProtocolID IN (6, 17) AND (Flows.ObservationTimestamp > GETUTCDATE() - 0.417)
GROUP BY Flows.Node.NodeID, Flows.ApplicationId, Flows.Application.Name, Flows.Application.PortName
ORDER BY TotalBytes DESC