Applications Systems

How to display all components polled for each polling engine in SAM

This article describes how to run an SQL query to show how many components are being polled in SAM. If running SAM with component-based licensing, this value can be higher than the licensed component count displayed in the SolarWinds Platform Web Console.

First published date

10/11/2018 3:13 PM

Last published date

8/22/2025 3:59 PM

Overview

As described in Check the number of available component monitors in my SAM license, you can see how many available component monitors remain in a component-based SAM license by navigating to Settings > All Settings > SAM Settings and clicking SAM License Summary.

Note: SolarWinds now offers node-based SAM licensing. See the SAM licensing model for details.

You can also view that information on the main License Details page, but neither page breaks out component data for individual polling engines. Another way to see licensing details is described in Report for component licenses by SAM.

This article describes how to run an SQL query to determine all components polled for each polling engine. This value is usually higher than the licensed component count displayed in the SolarWinds Platform Web Console. 

Product section

Server Application Monitor

Resolution

  1. Log into the SolarWinds Platform Server.
  2. Open Database Manager. (See Use Database Manager to view the SolarWinds database for details.)
  3. Run a query listed below.

Query 1:

-- Scripts are not supported under any SolarWinds support program or service.
-- Scripts are provided AS IS without warranty of any kind. SolarWinds further
-- disclaims all warranties including, without limitation, any implied warranties
-- of merchantability or of fitness for a particular purpose. The risk arising
-- out of the use or performance of the scripts and documentation stays with you.
-- In no event shall SolarWinds or anyone else involved in the creation,
-- production, or delivery of the scripts be liable for any damages whatsoever
-- (including, without limitation, damages for loss of business profits, business
-- interruption, loss of business information, or other pecuniary loss) arising
-- out of the use of or inability to use the scripts or documentation.

SELECT Count(ccs.ApplicationID) [Component Count], e.EngineID, ae.ServerName, ae.ServerType
FROM [dbo].[APM_CurrentComponentStatus] ccs
JOIN [APM_Application] ap ON ccs.ApplicationID = ap.ID
JOIN [Nodesdata] node ON ap.NodeID = node.NodeID
JOIN [Engines] e ON node.EngineID = e.EngineID
JOIN [Engines] ae ON ae.EngineID = e.EngineID
GROUP BY  e.EngineID, ae.ServerName, ae.ServerType
ORDER BY [Component Count] DESC

 

Query 2:

The following query lists only non-disabled components of non-unmanaged application monitors count per poller:

-- Scripts are not supported under any SolarWinds support program or service.
-- Scripts are provided AS IS without warranty of any kind. SolarWinds further
-- disclaims all warranties including, without limitation, any implied warranties
-- of merchantability or of fitness for a particular purpose. The risk arising
-- out of the use or performance of the scripts and documentation stays with you.
-- In no event shall SolarWinds or anyone else involved in the creation,
-- production, or delivery of the scripts be liable for any damages whatsoever
-- (including, without limitation, damages for loss of business profits, business
-- interruption, loss of business information, or other pecuniary loss) arising
-- out of the use of or inability to use the scripts or documentation.

SELECT Count(cc.ApplicationID) [Component Count], e.EngineID, ae.ServerName, ae.ServerType
FROM [dbo].[APM_Component] cc
JOIN [APM_Applications] ap ON cc.ApplicationID = ap.ID
JOIN [Nodes] node ON ap.NodeID = node.NodeID
JOIN [Engines] e ON node.EngineID = e.EngineID
JOIN [AllEngines] ae ON ae.EngineID = e.EngineID
where isdisabled is null and ap.Unmanaged = 0
GROUP BY  e.EngineID, ae.ServerName, ae.ServerType
ORDER BY [Component Count] DESC

 

Query 3:

The following example query determines if there are a large number of components in a single monitor type (such as AppInsight monitors): 

-- Scripts are not supported under any SolarWinds support program or service.
-- Scripts are provided AS IS without warranty of any kind. SolarWinds further
-- disclaims all warranties including, without limitation, any implied warranties
-- of merchantability or of fitness for a particular purpose. The risk arising
-- out of the use or performance of the scripts and documentation stays with you.
-- In no event shall SolarWinds or anyone else involved in the creation,
-- production, or delivery of the scripts be liable for any damages whatsoever
-- (including, without limitation, damages for loss of business profits, business
-- interruption, loss of business information, or other pecuniary loss) arising
-- out of the use of or inability to use the scripts or documentation.

SELECT Count(*) AS 'num'
FROM [APM_CurrentComponentStatus]
WHERE ApplicationID in (select ID from [dbo].[APM_Application]
WHERE Name like '%iis%')
ORDER BY num desc;

 

Query 4:

The following query lists the application IDs that are polling a large number of components: 

-- Scripts are not supported under any SolarWinds support program or service.
-- Scripts are provided AS IS without warranty of any kind. SolarWinds further
-- disclaims all warranties including, without limitation, any implied warranties
-- of merchantability or of fitness for a particular purpose. The risk arising
-- out of the use or performance of the scripts and documentation stays with you.
-- In no event shall SolarWinds or anyone else involved in the creation,
-- production, or delivery of the scripts be liable for any damages whatsoever
-- (including, without limitation, damages for loss of business profits, business
-- interruption, loss of business information, or other pecuniary loss) arising
-- out of the use of or inability to use the scripts or documentation.

SELECT ccs.ApplicationID, ap.Name, Count(ccs.ApplicationID) Component_Count, node.Caption, e.EngineID FROM [dbo].[APM_CurrentComponentStatus] ccs
JOIN [APM_Application] ap on ccs.ApplicationID = ap.ID
JOIN [Nodesdata] node on ap.NodeID = node.NodeID
JOIN [Engines] e on node.EngineID = e.EngineID
GROUP BY ap.Name, ccs.ApplicationID, node.Caption, e.EngineID
ORDER BY Component_Count DESC

 

Query 5:

The following query lists all the components and their current status:

-- Scripts are not supported under any SolarWinds support program or service.
-- Scripts are provided AS IS without warranty of any kind. SolarWinds further
-- disclaims all warranties including, without limitation, any implied warranties
-- of merchantability or of fitness for a particular purpose. The risk arising
-- out of the use or performance of the scripts and documentation stays with you.
-- In no event shall SolarWinds or anyone else involved in the creation,
-- production, or delivery of the scripts be liable for any damages whatsoever
-- (including, without limitation, damages for loss of business profits, business
-- interruption, loss of business information, or other pecuniary loss) arising
-- out of the use of or inability to use the scripts or documentation.

SELECT n.Caption AS NodeName, a.Name AS ApplicationName, c.Name AS ComponentName, ccs.ErrorMessage AS ComponentErrorMessage
  FROM APM_CurrentComponentStatus ccs
  JOIN APM_Component c ON ccs.ComponentID = c.ID
  JOIN APM_Application a ON c.ApplicationID = a.ID
  JOIN NodesData n ON a.NodeID = n.NodeID
  WHERE ccs.Availability != '1' AND (ccs.ErrorMessage IS NOT NULL AND ccs.ErrorMessage != '')

 

Query 6:

The following query lists components count per node without unmanaged nodes/applications and disabled components:

-- Scripts are not supported under any SolarWinds support program or service.
-- Scripts are provided AS IS without warranty of any kind. SolarWinds further
-- disclaims all warranties including, without limitation, any implied warranties
-- of merchantability or of fitness for a particular purpose. The risk arising
-- out of the use or performance of the scripts and documentation stays with you.
-- In no event shall SolarWinds or anyone else involved in the creation,
-- production, or delivery of the scripts be liable for any damages whatsoever
-- (including, without limitation, damages for loss of business profits, business
-- interruption, loss of business information, or other pecuniary loss) arising
-- out of the use of or inability to use the scripts or documentation.

SELECT n.Nodeid, n.Caption, count(c.id) as Count
FROM nodes n
JOIN APM_Application a on n.nodeid=a.nodeid
JOIN APM_Component c on a.id=c.applicationid

where IsDisabled is NULL and a.Unmanaged = 0 and n.UnManaged = 0
GROUP by n.nodeid, n.caption

order by count desc

 

Query 7:

The following query lists applications and their components per node without unmanaged nodes/applications and disabled components (use it in SQL Management Studio):

-- Scripts are not supported under any SolarWinds support program or service.
-- Scripts are provided AS IS without warranty of any kind. SolarWinds further
-- disclaims all warranties including, without limitation, any implied warranties
-- of merchantability or of fitness for a particular purpose. The risk arising
-- out of the use or performance of the scripts and documentation stays with you.
-- In no event shall SolarWinds or anyone else involved in the creation,
-- production, or delivery of the scripts be liable for any damages whatsoever
-- (including, without limitation, damages for loss of business profits, business
-- interruption, loss of business information, or other pecuniary loss) arising
-- out of the use of or inability to use the scripts or documentation.

SELECT n.Nodeid, n.Caption, a.name, c.name
FROM nodes n
JOIN APM_Application a on n.nodeid=a.nodeid
JOIN APM_Component c on a.id=c.applicationid
where IsDisabled is NULL and a.Unmanaged = 0 and n.UnManaged = 0
GROUP by n.nodeid, n.caption, a.name, c.name

 

Query 8:

The following query lists applications and their polling frequencies (both the setting at the template level and at the application level). If you include  the last line, query results will include applications polling under 300 second (default) intervals: 

-- Scripts are not supported under any SolarWinds support program or service.
-- Scripts are provided AS IS without warranty of any kind. SolarWinds further
-- disclaims all warranties including, without limitation, any implied warranties
-- of merchantability or of fitness for a particular purpose. The risk arising
-- out of the use or performance of the scripts and documentation stays with you.
-- In no event shall SolarWinds or anyone else involved in the creation,
-- production, or delivery of the scripts be liable for any damages whatsoever
-- (including, without limitation, damages for loss of business profits, business
-- interruption, loss of business information, or other pecuniary loss) arising
-- out of the use of or inability to use the scripts or documentation.

SELECT a.ID, a.Name, a.NodeID, a.TemplateID, asg.Value AS [Application Setting], ats.Value AS [Template Setting]
  FROM [dbo].[APM_Application] a
  LEFT JOIN [dbo].[APM_ApplicationTemplateSetting] ats ON (ats.ApplicationTemplateID = a.TemplateID AND ats.[Key] = '__Frequency' )
  LEFT JOIN [dbo].[APM_ApplicationSetting] asg ON (asg.ApplicationID = a.ID AND asg.[key] = '__Frequency')
  WHERE (asg.Value IS NOT NULL OR ats.Value IS NOT NULL)
  --AND (asg.Value < '300' OR ats.Value < '300')


The following query can be used to determine the number of used component monitors and licensed component monitors for individual polling engines:
 

-- Scripts are not supported under any SolarWinds support program or service.
-- Scripts are provided AS IS without warranty of any kind. SolarWinds further
-- disclaims all warranties including, without limitation, any implied warranties
-- of merchantability or of fitness for a particular purpose. The risk arising
-- out of the use or performance of the scripts and documentation stays with you.
-- In no event shall SolarWinds or anyone else involved in the creation,
-- production, or delivery of the scripts be liable for any damages whatsoever
-- (including, without limitation, damages for loss of business profits, business
-- interruption, loss of business information, or other pecuniary loss) arising
-- out of the use of or inability to use the scripts or documentation.

SELECT e.EngineID,
CASE 
WHEN at.CustomApplicationType IS NULL THEN 'Generic Applications' 
WHEN at.CustomApplicationType = 'ABAA' THEN 'Active Directory AppInsights'
WHEN at.CustomApplicationType = 'ABSA' THEN 'SQL AppInsights'
WHEN at.CustomApplicationType = 'ABIA' THEN 'IIS AppInsights'
WHEN at.CustomApplicationType = 'ABXA' THEN 'Exchange AppInsights'
WHEN at.CustomApplicationType = 'ABTA' THEN 'WSTM AppInsights'
ELSE at.CustomApplicationType END as ApplicationType,
COUNT(c.ID) as TotalComponents,
CASE 
WHEN at.CustomApplicationType = 'ABAA' 
THEN (SELECT COUNT(*) * 50
FROM [SolarWindsOrion].[dbo].[APM_Application] as a 
INNER JOIN [SolarWindsOrion].[dbo].[APM_ApplicationTemplate] as at ON a.TemplateID = at.ID WHERE at.CustomApplicationType = 'ABAA') -- Active Directory AppInsights
WHEN at.CustomApplicationType = 'ABSA' 
THEN (SELECT COUNT(*) * 50
FROM [SolarWindsOrion].[dbo].[APM_Application] as a 
INNER JOIN [SolarWindsOrion].[dbo].[APM_ApplicationTemplate] as at ON a.TemplateID = at.ID WHERE at.CustomApplicationType = 'ABSA') -- SQL AppInsights
WHEN at.CustomApplicationType = 'ABIA' 
THEN (SELECT COUNT(*) * 30
FROM [SolarWindsOrion].[dbo].[APM_Application] as a 
INNER JOIN [SolarWindsOrion].[dbo].[APM_ApplicationTemplate] as at ON a.TemplateID = at.ID WHERE at.CustomApplicationType = 'ABIA') -- IIS AppInsights
WHEN at.CustomApplicationType = 'ABXA' 
THEN (SELECT COUNT(*) * 50
FROM [SolarWindsOrion].[dbo].[APM_Application] as a 
INNER JOIN [SolarWindsOrion].[dbo].[APM_ApplicationTemplate] as at ON a.TemplateID = at.ID WHERE at.CustomApplicationType = 'ABXA') -- Exchange AppInsights
WHEN at.CustomApplicationType = 'ABTA' 
THEN (SELECT COUNT(*) * 5
FROM [SolarWindsOrion].[dbo].[APM_Application] as a 
INNER JOIN [SolarWindsOrion].[dbo].[APM_ApplicationTemplate] as at ON a.TemplateID = at.ID WHERE at.CustomApplicationType = 'ABTA') -- WSTM AppInsights

ELSE COUNT(c.ID) END AS LicensedComponents

FROM dbo.APM_Component AS c
INNER JOIN dbo.APM_Application AS a
ON c.ApplicationID = a.ID
INNER JOIN [dbo].[NodesData] as n
ON a.NodeID = n.NodeID
INNER JOIN dbo.Engines as e
ON n.EngineID = e.EngineID
LEFT JOIN dbo.APM_ComponentTemplate as ct 
ON C.TemplateID = ct.ID
LEFT JOIN dbo.APM_ApplicationTemplate as at 
ON ct.ApplicationTemplateID = at.ID
WHERE C.Retained = 0
AND (ISNULL(ct.VisibilityMode, 0) = 0 
OR (ct.VisibilityMode = 2 
AND C.ApplicationItemID IS NOT NULL) 
OR ct.VisibilityMode = 3)

GROUP BY e.EngineID, at.CustomApplicationType