I am specifically looking for the query that is used to generate the "Down Applications" widget
rmullal You can try turning on the "Hubble" option, which should show you the queries running on each page, as well as the how long each runs.
Also, you can check the actual resource files within the SolarWinds iis/web folder.
Additionally, you can download a decompiler (dotPeek/JetBrains) and poke around in the .dll files. (I'd recommend just copying the .dlls to your local machine, just for good measure)
I have used these 3 methods for a long time now, and have found some very interesting stuff over the years.
After turning on the Hubble option, using the "SolarWinds Log Adjuster" tool, located on the primary Orion server, I added the "Down Applications" widget to my page and refreshed to see what Hubble would show me. Hubble showed me the following query:
SELECT Application.ApplicationID,
Application.Name,
Application.NodeID,
Application.ApplicationTemplateID,
Application.CustomApplicationType,
Status.Availability,
Status.Timestamp,
Status.LastTimeUp,
Template.Name AS TemplateName,
Nodes.Caption as Caption,
Nodes.Status AS NodeStatus,
( SELECT Count(ccs.ApplicationID) AS c FROM Orion.APM.CurrentComponentStatus ccs
WHERE ccs.ApplicationID = Application.ApplicationID AND ccs.Availability = 0) as UnknownComponentCount,
( SELECT Count(ccs.ApplicationID) AS c FROM Orion.APM.CurrentComponentStatus ccs
WHERE ccs.ApplicationID = Application.ApplicationID AND ccs.Availability = 2) as DownComponentCount,
( SELECT Count(ccs.ApplicationID) AS c FROM Orion.APM.CurrentComponentStatus ccs
WHERE ccs.ApplicationID = Application.ApplicationID AND ccs.Availability in (1,5,6)) as UpComponentCount
FROM Orion.APM.Application AS Application
LEFT JOIN Orion.APM.CurrentApplicationStatus(nolock=true) as Status ON Application.ApplicationID = Status.ApplicationID
LEFT JOIN Orion.APM.ApplicationTemplate(nolock=true) as Template ON Application.ApplicationTemplateID = Template.ApplicationTemplateID
JOIN Orion.APM.ApplicationCustomProperties(nolock=true) AS APM_ApplicationCustomProperties
ON APM_ApplicationCustomProperties.ApplicationID = Application.ApplicationID
INNER JOIN Orion.Nodes(nolock=true) as Nodes ON Nodes.NodeID = Application.NodeID WHERE 1=1 AND ( Status.Availability='2' ) ORDER BY Application.Name RETURN XML RAW
Just for good measure, I checked the resource/widget source files on the IIS server too.
\inetpub\Orion\APM\Resources\Summary\DownApplications.ascx
And
\inetpub\Orion\APM\Resources\Summary\DownApplications.ascx.cs
From the little I actually know about how all the magic parts work, the .cs file appears to get the data to populate the grid from
SwisDAL.GetApplicationsByCurrentStatus
After poking around in the SolarWinds.APM.Web.dll, I found the reference to SwisDAL.GetApplicationsByCurrentStatus, and started cleaning up the queries kept in there. Not surprisingly, I found that exact SWQL query stored in that DLL, along with a bunch of other good info.
-
Well, either way, the SWQL query above is EXACTLY what you said you were looking for. I hope it helps you with what you need.
Thank you,
-Will
After turning on the Hubble option, using the "SolarWinds Log Adjuster" tool, located on the primary Orion server, I added the "Down Applications" widget to my page and refreshed to see what Hubble would show me. Hubble showed me the following query:
SELECT Application.ApplicationID,
Application.Name,
Application.NodeID,
Application.ApplicationTemplateID,
Application.CustomApplicationType,
Status.Availability,
Status.Timestamp,
Status.LastTimeUp,
Template.Name AS TemplateName,
Nodes.Caption as Caption,
Nodes.Status AS NodeStatus,
( SELECT Count(ccs.ApplicationID) AS c FROM Orion.APM.CurrentComponentStatus ccs
WHERE ccs.ApplicationID = Application.ApplicationID AND ccs.Availability = 0) as UnknownComponentCount,
( SELECT Count(ccs.ApplicationID) AS c FROM Orion.APM.CurrentComponentStatus ccs
WHERE ccs.ApplicationID = Application.ApplicationID AND ccs.Availability = 2) as DownComponentCount,
( SELECT Count(ccs.ApplicationID) AS c FROM Orion.APM.CurrentComponentStatus ccs
WHERE ccs.ApplicationID = Application.ApplicationID AND ccs.Availability in (1,5,6)) as UpComponentCount
FROM Orion.APM.Application AS Application
LEFT JOIN Orion.APM.CurrentApplicationStatus(nolock=true) as Status ON Application.ApplicationID = Status.ApplicationID
LEFT JOIN Orion.APM.ApplicationTemplate(nolock=true) as Template ON Application.ApplicationTemplateID = Template.ApplicationTemplateID
JOIN Orion.APM.ApplicationCustomProperties(nolock=true) AS APM_ApplicationCustomProperties
ON APM_ApplicationCustomProperties.ApplicationID = Application.ApplicationID
INNER JOIN Orion.Nodes(nolock=true) as Nodes ON Nodes.NodeID = Application.NodeID WHERE 1=1 AND ( Status.Availability='2' ) ORDER BY Application.Name RETURN XML RAW
Just for good measure, I checked the resource/widget source files on the IIS server too.
\inetpub\Orion\APM\Resources\Summary\DownApplications.ascx
And
\inetpub\Orion\APM\Resources\Summary\DownApplications.ascx.cs
From the little I actually know about how all the magic parts work, the .cs file appears to get the data to populate the grid from
SwisDAL.GetApplicationsByCurrentStatus
After poking around in the SolarWinds.APM.Web.dll, I found the reference to SwisDAL.GetApplicationsByCurrentStatus, and started cleaning up the queries kept in there. Not surprisingly, I found that exact SWQL query stored in that DLL, along with a bunch of other good info.
-
Well, either way, the SWQL query above is EXACTLY what you said you were looking for. I hope it helps you with what you need.
Thank you,
-Will
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 195,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process.