Windows 7 / Windows 2008 R2 uzerinde netsh ile ETW trace’ler toplanmasi

Tekrar merhaba,

Daha onceki bir yazimizda, Windows 7 ve Windows 2008 R2 uzerinde netsh trace komutunu kullanarak kolayca network trace toplanabileceginden bahsetmistik (https://blogs.technet.com/b/platformtr/archive/2010/04/16/windows-7-windows-2008-r2-zerinde-netsh-komutu-ile-network-trace-toplanmas.aspx). Bugunku yazimizda ise buna ek olarak belli problem durumlarinda "netsh trace" komutunun diger ozelliklerini kullanarak nasil ilave ETW trace toplanabileceginden bahsedecegiz.

Windows 7 ile birlikte, neredeyse tum Windows component'leri icin ETW tracing mekanizmasi aktif hale getirildi. Artik bu sayede eskiden goremeyecegimiz detayda bilgilere ulasabiliyoruz. Hatta her bir component icin ayri ayri ETW trace'leri aktif hale getirmek yerine, senaryo bazli olarak da tek bir seferde o senaryonun icinde yer alan tum componentler icin ETW trace baslatilmasini da saglayabiliyoruz. Bunun icin gene "netsh trace" komutunu kullanmamiz gerekiyor:

C:\Test>netsh trace show scenarios

Available scenarios (18):
-------------------------------------------------------------------
AddressAcquisition : Troubleshoot address acquisition-related issues
DirectAccess : Troubleshoot DirectAccess related issues
FileSharing : Troubleshoot common file and printer sharing problems
InternetClient : Diagnose web connectivity issues
InternetServer : Troubleshoot server-side web connectivity issues
L2SEC : Troubleshoot layer 2 authentication related issues
LAN : Troubleshoot wired LAN related issues
Layer2 : Troubleshoot layer 2 connectivity related issues
MBN : Troubleshoot mobile broadband related issues
NDIS : Troubleshoot network adapter related issues
NetConnection : Troubleshoot issues with network connections
P2P-Grouping : Troubleshoot Peer-to-Peer Grouping related issues
P2P-PNRP : Troubleshoot Peer Name Resolution Protocol (PNRP) related issues
RemoteAssistance : Troubleshoot Windows Remote Assistance related issues
RPC : Troubleshoot issues related to RPC framework
WCN : Troubleshoot Windows Connect Now related issues
WFP-IPsec : Troubleshoot Windows Filtering Platform and IPsec related issues
WLAN : Troubleshoot wireless LAN related issues

Yukarida da gorebileceginiz gibi su an icin Windows 7 uzerinde toplam 18 farkli senaryo icin ETW trace baslatilabiliyor.

Ornegin belli bir web sitesine erisim ile ilgili problem yasiyorsunuz ya da Wireless connection asamasinda bir problem olusuyor ya da Windows 7 client'iniz IP adres alamiyorsaniz burada bahsedilen metodu kullanarak cok detayli bilgiler iceren loglar toplamak mumkun. Bu tur problemler pek cok nedenden kaynaklanabilirler ve degisik sekillerde troubleshooting yapilabilir her birisi icin. Eger klasik anlamda troubleshooting ile bir sonuca varamiyorsaniz, bu durumda probleme konu olabilecek component'lerin ETW trace'lerinin toplanmasi problemin nedenini cozme konusunda size yardimci olabilir. Burada toplanan ETW trace'leri kendiniz de isterseniz Microsoft Network Monitor yazilimini kullanarak convert edip analiz edebilirsiniz.

Belli bir senaryo icin ETW trace aktif hale getirildiginde, hangi spesifik component'lar icin otomatik olarak ETW trace toplanacagini da gorebilirsiniz. Ornegin:

C:\Test>netsh trace show scenario wlan

Description: Troubleshoot wireless LAN related issues

Providers
---------

Provider:
Name: Microsoft-Windows-NWiFi
Provider Guid: {0BD3506A-9030-4F76-9B88-3E8FE1F7CFB6}
Default Level: 4 (win:Informational)
Default Keywords: 0x0

Provider:
Name: Microsoft-Windows-VWiFi
Provider Guid: {314B2B0D-81EE-4474-B6E0-C2AAEC0DDBDE}
Default Level: 5
Default Keywords: 0x0

Provider:
Name: Microsoft-Windows-L2NACP
Provider Guid: {85FE7609-FF4A-48E9-9D50-12918E43E1DA}
Default Level: 4 (win:Informational)
Default Keywords: 0x0

Provider:
Name: Microsoft-Windows-WLAN-AutoConfig
Provider Guid: {9580D7DD-0379-4658-9870-D5BE7D52D6DE}
Default Level: 4 (win:Informational)
Default Keywords: 0x0

Provider:
Name: Microsoft-Windows-EapHost
Provider Guid: {6EB8DB94-FE96-443F-A366-5FE0CEE7FB1C}
Default Level: 4 (win:Informational)
Default Keywords: 0x0

Provider:
Name: Microsoft-Windows-OneX
Provider Guid: {AB0D8EF9-866D-4D39-B83F-453F3B8F6325}
Default Level: 4 (win:Informational)
Default Keywords: 0x0

Provider:
Name: Microsoft-Windows-NDIS
Provider Guid: {CDEAD503-17F5-4A3E-B7AE-DF8CC2902EB9}
Default Level: 4 (win:Informational)
Default Keywords: 0x0

Dolayisiyla WLAN senaryosu icin ETW trace baslatirsak, bu durumda 7 farkli component icin otomatik olarak ETW trace toplanacaktir (ki goruldugu gibi bu senaryo baslatildiginda 802.1x, EAP gibi wireless erisim ile bire bir iliskili component'lerin trace'i baslatilacaktir)

Ornegin WLAN senaryosunu baslatmak istersek:

C:\Test>netsh trace start scenario=WLAN capture=yes tracefile=wlanetwtrace.etl

Trace configuration:
-------------------------------------------------------------------
Status: Running
Trace File: C:\Test\wlanetwtrace.etl
Append: Off
Circular: On
Max Size: 250 MB
Report: Off

gibi bir komutu calistirilabilir. Yukaridaki komutu calistirdiktan sonra Wireless baglanti problemimizi tekrar olusturup ardindan bu senaryo icin trace toplanmasini asagidaki sekilde durdurabiliriz:

Not: Yukaridaki komutta "capture=yes" parametresinin kullanilmasi, ilgili component'ler icin ETW trace toplanirken beraberinde bir network trace'de toplanmasini saglayacaktir. (ki bu tur sorunlarda network trace'ler gercekten onem kazanmaktadir sorununu kaynagini tespit etme acisindan)

C:\Test>netsh trace stop
Correlating traces ... done
Generating data collection ... done
The trace file and additional troubleshooting information have been compiled as "C:\Test\wlanetwtrace.cab".
File location = C:\Test\wlanetwtrace.etl
Tracing session was successfully stopped.

Senaryo icin trace yukaridaki sekilde durdurulduktan sonra iki ayri dosya yaratilacaktir:

wlanetwtrace.etl (farkli component'lerin ETW trace'lerinin birlestirildigi tek bir ETW trace. Network trace'de bu dosya icine yazilmaktadir)
wlanetwtrace.cab (sistem hakkinda bilgi veren pek cok ilave dosya. Ornegin: gpresult.txt, dns.txt, adapterinfo.txt, vs vs)

Bundan sonra bu ETL dosyayi acmak icin Network Monitor'u kullanabiliriz. Tabi esas sorun cozumu bundan sonra bu ETL dosyalarin analiziyle baslayacaktir. Ornegin bir WLAN problemi analiz ediliyorsa, bu ETW trace'lerden anlamli bilgiler cikartabilmek icin 802.1x protokolunun isleyisini bilmek, Windows tarafinda Wireless network konfigurasyonlari ile ilgili ayrintilari bilmek isinizi cok kolaylastirabilir.

Konuyla ilgili daha ayrintili bilgilere asagidaki linkten'de ulasabilirsiniz:
https://msdn.microsoft.com/en-us/library/dd569142(VS.85).aspx Using Netsh to Manage Traces

Gorusmek uzere,
Murat