How To Query Performance Monitor Counters Using a Web Page

Q: We would like to find a way to query our IIS server's performance in real time using a web page. Is there some way to use ASP to connect to performance monitor to get a reading on different counters?

A: The Windows 2000 Resource Kit includes a utility called the Performance Counter Check (perfcheck.dll) that you can use on Windows 2000 and Windows Server 2003 computers to query performance monitor and display the results. For IIS 4 you can use the Windows Performance Data Helper DLL (pdh.dll), available with the Windows NT 4.0 Platform software development kit (SDK). There is a free, non-Microsoft developed component available at http://www.alphasierrapapa.com/IisDev/Components/Perfmon/. If you're using ASP.net, there is a class named "Peformancecounter” that allows you to query performance monitor counters without any supporting software (other than ASP.net of course). See http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemdiagnosticsperformancecounterclassctortopic.asp for more details.

原文地址:https://www.cnblogs.com/Dream/p/1264.html