Create html chart for cpu usage processes on an RDS server

Hi,

I'd like to create a pie chart (https://canvasjs.com/javascript-charts/animated-chart/) of process on an Remote Desktop server (multiple users logged on) and their usage of CPU (later on memory). Reason: cpu is peaking at 80% and we would like to know which processes from which users are using most of cpu resources. This on a regular basis.

I'd like to retreive the data from the Windows machines via powershell, so I could start with get-process ....
Please advise on approach.

J.
janhoedtAsked:
Who is Participating?
 
Chinmay PatelEnterprise ArchitectCommented:
Hi janhoedt,

I think you are already on the right track. User PowerShell

 
gwmi Win32_PerfFormattedData_PerfProc_Process | 
    ?{$_.Name -notmatch '_Total'} | 
    sort PercentProcessorTime -desc | 
    select | 
    ft -auto Name,IDProcess,PercentProcessorTime

Open in new window



Once you confirm that this data is right, we can save it to the disk by Out-File <<FileName>> You can use ConvertTo-Json to output directly as a JSON file.

The last step would be, to read that JSON file, and display it as a chart.

I was wondering, is it must for you to use PowerShell? would you be open to use any tool that can do this? I mean generating proper input file for the charting component.

Regards,
Chinmay.
1
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.