‎06-13-2019 02:15 PM
Select Top 5 tblAssets.AssetID,
tblAssets.AssetName,
Cast(Avg(tblPerformanceCountersScanMetric.Value) As int) As
[Avarage RAM 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.Name = 'Used physical memory' And
tblAssetCustom.State = 1
Group By tblAssets.AssetID,
tblAssets.AssetName,
Coalesce(tsysOS.Image, tsysAssetTypes.AssetTypeIcon10),
tsysPerformanceCounterMetric.Name
Having Max(tblPerformanceCountersScan.ScanDateTime) > GetDate() - 7
Order By [Avarage RAM usage in %] Desc
‎08-12-2019 06:36 PM
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now