cancel
Showing results forย 
Showย ย onlyย  | Search instead forย 
Did you mean:ย 
Massimo_Braga
Engaged Sweeper
good morning.
I found these instructions for two separate reports, covering average CPU and RAM usage:

CPU:

Select Top 1000000 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


RAM:

Select Top 1000000 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


Please, does anyone know a way to merge these two reports in order to have a single report with the average usage of RAM and CPU (possibly even the disk please?)
0 REPLIES 0