04-23-2019 11:17 AM
Select Top 5 tblAssets.AssetID,
tblAssets.AssetName,
Cast(Avg(tblPerformanceCountersScanMetric.Value) As int) As
[Average CPU usage in %],
Coalesce(tsysOS.Image, tsysAssetTypes.AssetTypeIcon10) As icon,
Max(tblPerformanceCountersScan.ScanDateTime) As [Last scan]
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblPerformanceCountersScan On tblAssets.AssetID =
tblPerformanceCountersScan.AssetId
Inner Join tblPerformanceCountersScanMetric On tblPerformanceCountersScan.Id =
tblPerformanceCountersScanMetric.PerformanceCountersScanId
Left Join tblPerformanceCountersScanMetricIdentifier On
tblPerformanceCountersScanMetricIdentifier.Id =
tblPerformanceCountersScanMetric.PerformanceCountersScanMetricIdentifierId
Inner Join tsysPerformanceCounterMetric On tsysPerformanceCounterMetric.Id =
tblPerformanceCountersScanMetric.Metric
Left Join tsysOS On tsysOS.OScode = tblAssets.OScode
Where tsysPerformanceCounterMetric.[Group] = 'CPU' And tblAssetCustom.State = 1
Group By tblAssets.AssetID,
tblAssets.AssetName,
Coalesce(tsysOS.Image, tsysAssetTypes.AssetTypeIcon10)
Having Max(tblPerformanceCountersScan.ScanDateTime) > GetDate() - 7
Order By [Average CPU usage in %] Desc
04-24-2019 11:52 AM
04-24-2019 11:43 AM
04-24-2019 11:04 AM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now