2012-01-10 23 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

相關問題