Perfmon is likely the first tool you think to when it comes to monitor some internals and performance of your application and it’s relatively easy to find out information and resources on the Internet; unfortunately this seems to also be a fragile component and every now and then we receive new calls about it: event log spammed with warnings about missing or corrupted counters, values returned are inconsistent or clearly wrong etc…
Messages like the following can appear after for example installing the .NET Framework 2.0 on your machine:
The Open Procedure for service "ASP.NET" in DLL "C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_perf.dll" failed. Performance data for this service will not be available. Status code returned is data DWORD 0
To note that such warnings are logged even if your application is not running.
First of all you can try to disable any third party services and processes (for example using msconfig.exe or Autoruns) and see if the problem still reproduces. If it does, you can use How to manually rebuild Performance Counter Library values to try to fix it manually, or try the following:
================ sample Perfini.txt :================== C:\WINDOWS\system32\axperf.ini:drivername=ASP C:\WINDOWS\system32\esentprf.ini:drivername=ESENT C:\WINDOWS\system32\ftpctrs.ini:drivername=MSFTPSVC C:\WINDOWS\system32\iasperf.ini:drivername=IAS C:\WINDOWS\system32\infoctrs.ini:drivername=inetinfo C:\WINDOWS\system32\mqperf.ini:drivername=MSMQ C:\WINDOWS\system32\msdtcprf.ini:drivername=MSDTC C:\WINDOWS\system32\ntdsctrs.ini:drivername=NTDS C:\WINDOWS\system32\ntfrscon.ini:drivername=FileReplicaConn C:\WINDOWS\system32\ntfrsrep.ini:drivername=FileReplicaSet C:\WINDOWS\system32\perfci.ini:drivername=ContentIndex C:\WINDOWS\system32\perffilt.ini:drivername=ContentFilter C:\WINDOWS\system32\perfwci.ini:drivername=ISAPISearch C:\WINDOWS\system32\pschdprf.ini:drivername=PSched C:\WINDOWS\system32\rasctrs.ini:drivername=RemoteAccess C:\WINDOWS\system32\tslabels.ini:drivername=TermService C:\WINDOWS\system32\w3ctrs.ini:drivername=W3SVC ================ Sample Perfini.txt :==================
================ sample Perfini.txt :==================
C:\WINDOWS\system32\axperf.ini:drivername=ASP C:\WINDOWS\system32\esentprf.ini:drivername=ESENT C:\WINDOWS\system32\ftpctrs.ini:drivername=MSFTPSVC C:\WINDOWS\system32\iasperf.ini:drivername=IAS C:\WINDOWS\system32\infoctrs.ini:drivername=inetinfo C:\WINDOWS\system32\mqperf.ini:drivername=MSMQ C:\WINDOWS\system32\msdtcprf.ini:drivername=MSDTC C:\WINDOWS\system32\ntdsctrs.ini:drivername=NTDS C:\WINDOWS\system32\ntfrscon.ini:drivername=FileReplicaConn C:\WINDOWS\system32\ntfrsrep.ini:drivername=FileReplicaSet C:\WINDOWS\system32\perfci.ini:drivername=ContentIndex C:\WINDOWS\system32\perffilt.ini:drivername=ContentFilter C:\WINDOWS\system32\perfwci.ini:drivername=ISAPISearch C:\WINDOWS\system32\pschdprf.ini:drivername=PSched C:\WINDOWS\system32\rasctrs.ini:drivername=RemoteAccess C:\WINDOWS\system32\tslabels.ini:drivername=TermService C:\WINDOWS\system32\w3ctrs.ini:drivername=W3SVC
================ Sample Perfini.txt :==================
Using this information unload und load the counter in System32:
unlodctr <drivername> lodctr <ini file> <drivername> driver's name from Perfini.txt <ini file> listed “.ini” files in Perfini.txt
Example: ASP Drivername: axperf.ini:drivername=ASP
unlodctr ASP lodctr axperf.ini
Or using the following command you can transfer settings from a working machine to a not working one:
lodctr /s:Perf_all.ini lodctr Perf_all.ini Reboot Check Perfdiag
If nothing else works as you wish or you do not want to waste time troubleshooting and just need the machine up and running without much annoyances you can disable the counters for the problematic service(s), of course at the cost of not having those data if you’ll ever need them.
For this task you can use Exctrlst.exe utility from the OS Resource Kit (see Exctrlst Overview and Exctrlst UI); it disables the specific counter by adding a registry key similar to the example below. You can add these registry entries under the specific counter entry manually if Exctrlst.exe is not available or desirable
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Spooler\Performance Value name: Disable Performance Counters Value type: REG_DWORD Value data: 1
Carlo
Carlo, va menzionato che su Windows Server 2003 (non valeva su 2000) esiste anche
lodctr /R
che tenta di "aggiustare" un po' tutti i counters di sistema (e spesso riesce) in automatico.
vale la pena provare se gia' quello risolve.
Se poi quello non va, tutta la procedura di ricostruzione con UNLODCTR && LODCTR che hai descritto e' ovviamente la migliore (togli e ricarichi i SINGOLI counter, per applicazione/servizio).
Inoltre vale la pena notare che, quando togli e rimetti i counter a quel livello, alcune applicazioni di monitoring che accedono ai dati dallo strato piu' alto (WMI) e non con le performance library, potrebbero ancora avere problemi.... pertanto, dopo aver fatto la procedura consigliata da te conviene anche fare un bel
WMIADAP /CLEARADAP
WMIADAP /RESYNCPERF
per ri-sincronizzare le informazioni tra le performance library e le classi WMI che le ri-espongono.
Ciao, keep up the grat work, il tuo blog e' sempre una bella lettura - utile e informativo!!!