Custom SWQL Query to Identify the Top 10 SolarWinds Orion Nodes by Their Number of NPM Elements

Below is a SWQL query which can be used to determine which nodes in your SolarWinds Orion environment have the most elements. What is an element? In NPM, every node, volume and interface counts as an element. Which leads to, why is this important? For one, SolarWinds Network Performance Monitor (NPM) is typically licensed by the number of elements, unless you are one of the newer nodes based licensing options. If you have a large environment, this also comes in helpful when trying to balance the load across your polling engines. Typically, a polling engine is limited to ~12,000 elements before your polling frequencies start to automatically slow down (unless you're stacking polling engine licenses and have the computer resources to support it).

SELECT TOP 10 i.Interfaces + v.Volumes + 1 AS [Elements]
    , n.Caption AS [Node]
    , n.NodeID
    , n.IP_Address AS [IP]
    , n.Vendor
    , n.MachineType
FROM Orion.Nodes n
INNER JOIN (SELECT COUNT(InterfaceID) AS [Interfaces], NodeID FROM Orion.NPM.Interfaces GROUP BY NodeID) AS i ON i.NodeID=n.NodeID
INNER JOIN (SELECT COUNT(VolumeID) AS [Volumes], NodeID FROM Orion.Volumes GROUP BY NodeID) AS v ON v.NodeID=n.NodeID
    , n.Caption
    , n.IP_Address
    , n.Vendor
    , n.MachineType
    , i.Interfaces
    , v.Volumes
ORDER BY [Elements] DESC

If you're unfamiliar with SWQL and how to run it, I'll list a few ways below.

  1. You can go to https://<OrionURL>/orion/Admin/swis.aspx in your environment, past the code in the box, and execute it. You'll have to replace "https://<OrionUrl>" with the URL for your environment, of course.
  2. If you have the OrionSDK installed, you can run it in SWQL Studio.
  3. If you have the OrionSDK installed, you can run the query with the "Get-SwisData" PowerShell cmdlet.
  4. You can use the query above as a data source for a report or custom dashboard widget.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Issue Where SolarWinds Orion Agents Show As Connected But They Are Not Updating Statistics (RESOLVED)

This issue can easily slip by unnoticed. All of that status indicators still show green, so everything is good, right? Not so! Statistics an...