[英]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. 我想使用C#创建一个简单的Windows服务,它可以每5分钟左右检查Windows系统上最常见的性能计数器,并将结果上传到WCF服务。
My questions are: 我的问题是:
1) Having never worked with Performance Counters in .NET, is this something that is fairly simple to do? 1)从未使用.NET中的性能计数器,这是一件相当简单的事情吗?
2) Are there any permission issues I need to concern myself with? 2)我需要关注自己的许可问题吗? The service will likely be running under "localsystem" or a domain user account.
该服务可能会在“localsystem”或域用户帐户下运行。
3) What are the common performance counters I should be looking for... Memory, CPU, Disk? 3)我应该寻找什么常见的性能计数器...内存,CPU,磁盘?
4) Has anyone else written code similar to this and do they have any examples to get me started? 4)是否有其他人编写了与此类似的代码,他们是否有任何示例让我开始?
Any help would be appreciated. 任何帮助,将不胜感激。
使用.NET监控性能计数器并不难,但我建议使用现有的工具(例如SCOM )来完成这项工作。
In case others may find this useful (or myself in the future) ;) 万一其他人可能会发现这有用(或将来我自己);)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.