Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Service and Performance Info using C#

We have hundreds of database and application servers in our datacenter and we are currently using various third party tools to monitor. All appear to have their stengths and weaknesses.

I would like to create a simple Windows Service using C# that can check the most common performance counters on a Windows system every 5 mins or so and upload the results to a WCF service.

My questions are:

1) Having never worked with Performance Counters in .NET, is this something that is fairly simple to do?

2) Are there any permission issues I need to concern myself with? The service will likely be running under "localsystem" or a domain user account.

3) What are the common performance counters I should be looking for... Memory, CPU, Disk?

4) Has anyone else written code similar to this and do they have any examples to get me started?

Any help would be appreciated.

like image 565
user500741 Avatar asked Nov 14 '22 19:11

user500741


1 Answers

Monitoring performance counters isn't hard using .NET however I recommend using existing tools (such as SCOM) that will do exactly this for you.

like image 101
Emond Avatar answered Dec 18 '22 07:12

Emond