2012-01-10 65 views
0

希望这个问题有一个简单的答案,我忽略!我有一个IIS网络服务器上有多个网站。在Perfmon中,它们显示为w3wp#1,w3wp#2等......我正在编写一个Logman脚本,它将使用我指定的计数器/实例来收集性能计数器数据,并且我只想收集任何w3wp工作进程。如何在Windows上为Perfmon/LogMan指定性能计数器时仅获取w3wp实例?

我已经尝试了几种方法,但没有运气:

\.NET CLR Memory(*w3wp*)\ 
    \.NET CLR Memory(w3wp#*)\ 
    \.NET CLR Memory(w3wp*)\ 

我看过的文档here,而且好像它声称支持通配符,但部分匹配。我不知道该怎么做。有什么方法可以完成我想要的吗?希望我解释得很好。让我知道是否需要更多细节。

谢谢!

回答

0

我想出了一个自定义批处理脚本,它查找应用程序池ID和PID,并将其与相关的IIS工作进程相关联。从那里,我可以在我的perfmon配置文件中手动查找并替换一个通用占位符,以开始收集特定站点。如果有兴趣,我可以提供一些细节。

+1

您能提供详细资料吗?我有类似的需求。谢谢。 – 2013-01-12 13:48:53

1

有一种方法可以通过附加进程ID来显示实例。由于ProcessId不会改变,所以有助于确定正确的实例。这篇文章描述了方法 - Perfmon: Identifying processes by PID instead of instance

相关部件从链接:

Making below registry change will display processes in the format of **ProcessName_PID** instead of **ProcessName#1**. 
Click Start, click Run, type regedit, and then click OK. 
Locate and then click the following registry subkey: 

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PerfProc\Performance 
On the Edit menu, click New, and then click DWORD Value. 
Right-click New Value #1, click Rename, and then type ProcessNameFormat to name the new value. 
Right-click ProcessNameFormat, and then click Modify. 
In the Data value box, type one of the following values, and then click OK: 

    1: Disables PID data. This value is the default value. 
    2: Enables PID data. 

Exit Registry Editor. 

Warning: Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall the operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk. 

Important: If you enable this feature, you may be unable to monitor process-specific information by using third-party utilities or custom-made programs, and this functionality may change at any time in the future without notice. 

希望它可以帮助别人。

+0

虽然这个链接可能回答这个问题,但最好在这里包含答案的重要部分,并提供供参考的链接。如果链接页面更改,则仅链接答案可能会失效。 – Luke 2015-06-15 09:11:57

+0

@Luke - 感谢您的反馈。我已经用链接中的相关描述更新了答案。 – 2015-06-15 11:43:58