This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Is it possible to see the SQL/SWQL for certain widgets?

I am specifically looking for the query that is used to generate the "Down Applications" widget

  •  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.

  • Would the query not be in the Resources table in the Database? I’ll look on my system once I’m in the office
  • 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

  • exactly what i'm looking for  ! thank you.