2 Replies Latest reply on Dec 10, 2015 9:00 AM by cyr0nk0r

    SWQL for top XX nodes by average response time

    cyr0nk0r

      Currently the built in resource for Top XX nodes by average response time includes a packet loss column.

      We wish to remove this column.

      1.jpg

      I've tried to do a custom table, and can replicate everything, however it adds a bunch of formatting at the top that is undesirable.

      2.jpg

       

      Does anyone have SWQL code for replicating the Top XX nodes by Average response time while maintaining the link to the node and its status icon?

        • Re: SWQL for top XX nodes by average response time
          humejo

          Sure, here you go!

           

           

          SELECT

          n.Caption AS Node,

          n.DetailsUrl AS [_Linkfor_Node],

          '/Orion/images/StatusIcons/Small-' + n.StatusIcon AS [_Iconfor_Node],

          TOSTRING(n.AvgResponseTime) + ' ms' AS [Average Response Time]

          FROM Orion.Nodes n

          WHERE n.Status NOT IN (0, 2, 9, 12)

          ORDER BY AvgResponseTime DESC

           

          You can of course add to or modify the WHERE clause to your hearts content.  You can also add any custom property values or system property values you may want to display with the nodes.  To add custom properties just do something like this:

           

          SELECT

          n.Caption AS Node,

          n.DetailsUrl AS [_Linkfor_Node],

          '/Orion/images/StatusIcons/Small-' + n.StatusIcon AS [_Iconfor_Node],

          n.CustomProperties.YOURCUSTOMPROPERTYHERE AS [WHATEVERYOUWANTTONAMETHECOLUMNHERE],

          TOSTRING(n.AvgResponseTime) + ' ms' AS [Average Response Time]

          FROM Orion.Nodes n

          WHERE n.Status NOT IN (0, 2, 9, 12)

          ORDER BY AvgResponseTime DESC



          Also, if you have Additional Polling Engines, you may want to display that in the resource (as a reminder to the user what polling engine is measuring the response time, since distance plays a large part in the response time value).  You can do that like this:

           

          SELECT

          n.Caption AS Node,

          n.DetailsUrl AS [_Linkfor_Node],

          '/Orion/images/StatusIcons/Small-' + n.StatusIcon AS [_Iconfor_Node],

          TOSTRING(n.AvgResponseTime) + ' ms' AS [Average Response Time]

          n.Engine.ServerName AS [Polling Engine]

          FROM Orion.Nodes n

          WHERE n.Status NOT IN (0, 2, 9, 12)

          ORDER BY AvgResponseTime DESC

           

           

          Lastly, I didn't put a TOP 10 clause or anything since a Custom Query resource automatically displays the first 5 results and allows you to change the page size, so usually there isn't really a need to do anything other than sort it with an ORDER BY clause.

           

          Here is what it looks like when done:

          Enjoy!

            

               -HumeJo

              Loop1 Systems: SolarWinds Training and Professional Services      

          1 of 1 people found this helpful