Click here to Skip to main content
15,893,381 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my current project, I need to get CPU utilization.
Example, I will have the IP, username and password of the server. I will ping that server using c# from my application and it will give CPU usage. The server will be under the same network.

Is it possible to get CPU usage?

What I have tried:

Till now, when I ping the IP address it is responding the server is turned off or not.
Posted
Updated 28-Nov-18 8:28am

PING is just that: "are you there?" - and all the information you can get from it is a time for the round trip, which gives an "I'm alive!" signal - no other information is transferred.

I'm not sure you can get the remote computer's CPU stats without writing an app running on the server which responds to you when requested.
 
Share this answer
 
Comments
[no name] 28-Nov-18 13:51pm    
If I have server username and password, is it possible?
Google for "get remote cpu usage C#[^]" and start reading.
 
Share this answer
 
IF you can access this information from the Computer Management Application on your computer; you should be able to access it using the PerformanceCounter class.
 
Share this answer
 
Comments
[no name] 3-Dec-18 7:31am    
I have used PerformanceCounter. I am getting error Access to deny. But its working fine to get own server information.
MadMyche 3-Dec-18 9:16am    
Sounds like a permission error; if you cannot get access possibly a "special user" could be created and impersonation could be used. Not my forte

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