Click here to Skip to main content
15,884,425 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am trying to get remote servers cpu usage but I do not know how to configure and connect to that servers to get the information.The servers are not at the same network.

What I have tried:

var data = Process.GetCurrentProcess();
var mem = data.WorkingSet64;
var cp = data.TotalProcessorTime;
PerformanceCounter total_cpu = new PerformanceCounter("Process", "% Processor Time", "_Total");
PerformanceCounter process_cpu = new PerformanceCounter("Process", "% Processor Time", data.ProcessName);
Posted
Updated 5-Jun-20 21:54pm
v2

1 solution

 
Share this answer
 
Comments
Member 14512875 8-Jun-20 0:22am    
Hi Richard MacCutchan what if server is linux server.Will this work for linux server also?
Richard MacCutchan 8-Jun-20 3:39am    
No, Linux is a totally different Operating System.
Member 14512875 8-Jun-20 4:17am    
So do you have any solution for linux server?
Richard MacCutchan 8-Jun-20 4:54am    
You would need an agent application in the server that provides the data you want. This is not a simple programming issue.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900