How To Query Performance Monitor Counters Using a Web Page
Posted on 2004-02-16 08:00 Dream 阅读(756) 评论(0) 编辑 收藏 举报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.