Please help us determine the exact count of devices.
In the Operator Console (OC), if you see a Discovered count of let's say 100, and the 'Monitored Devices' count is 80, that means out of 100 devices discovered, 80 probes have collected device data in the last 30 minutes.
Below is the query used to calculate and display the 'Monitored Devices' in OC:
select * from (select 'total_device_count' as type, count(*) as device_count from cm_computer_system
union
select 'active_device_count' as type, count(DISTINCT(CASE WHEN sqs.sampletime is not NULL THEN ccs.cs_id ELSE NULL END)) as device_count
from cm_computer_system ccs
join cm_device cd
on ccs.cs_id = cd.cs_id
join cm_configuration_item cci
on cd.dev_id = cci.dev_id
join cm_configuration_item_metric ccim
on cci.ci_id = ccim.ci_id
join s_qos_data sqd
on ccim.ci_metric_id = sqd.ci_metric_id
join s_qos_snapshot sqs
on sqd.table_id = sqs.table_id
and CAST(sqs.sampletime as datetime) >= DATEADD(MINUTE, -30, CURRENT_TIMESTAMP)) src
pivot (sum(device_count) for type in (total_device_count,active_device_count))piv
This is the underlying query for 'Monitored Devices' in OC and when executed it yields two columns with data, the Total Device Count (Discovered) and the Active Device Count.