27 Replies Latest reply on Dec 20, 2016 8:53 AM by abdulraheemsidz

    Win32_PerfRawData_PerfProc_Process - Invalid Class

    aLTeReGo

      For much longer than I care to admit I was struggling to monitor any Windows services using WMI on one of my Windows 2008 Servers. Instead I received the dreaded "Invalid Class" error in the APM info window. This was later confirmed using WBEMTEST. When using WMI Explorer it was clear to see that the "Win32_PerfRawData_PerfProc_Process" class did not exist. 

      I opened a case with Solarwinds support and was directed to their WMI support document and related online documentation. Unfortunately none of the information provided proved useful in this circumstance.

      I spent a several hours googling around and was able to find several others with my issue, but no one had found a solution. With nowhere else to go, I spent the $250.00 and called Microsoft Support. It took a few days, and at least three Microsoft support engineers later that we finally got to the root of the problem. I knew from the very beginning that this was going to be something stupid, but I never realized just how obscure the problem would be, so I decided to save others my pain and post my resolution in hopes that others might find it useful in the future. 

      We went into registry “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\PerfProc\Performance” In the right hand pane we found that “Disable Performance Counters” was set to 1, which means it was disabled. We used “exctrlst.exe” tool, enabled ‘perfproc’ and rebooted. After Rebooting we were able to run the WMI query (SELECT * from Win32_PerfRawData_PerfProc_Process where NAME <> '_Total') using the WBEMTEST tool built into Windows. After verifying with WBEMTEST I confirmed that APM was properly polling my monitored services properly. 

      I hope someone else finds this helpful.

        • Re: Win32_PerfRawData_PerfProc_Process - Invalid Class

          Thanks Alterego for posting this--it will help the community.

          M

          • Re: Win32_PerfRawData_PerfProc_Process - Invalid Class
            Craig Norborg

            This fixed the problem I was having, thanx!!

            • Re: Win32_PerfRawData_PerfProc_Process - Invalid Class
              Questionario

              fixed our problem as well...

              however we didnt use the microsoft tool (difficult procedure to install new software on servers...), for us it was enough to set the registry entry to 0 (and reboot the server of course)

               

              thanks for sharing this with us

              • Re: Win32_PerfRawData_PerfProc_Process - Invalid Class
                Graeme

                aLTeReGo you're a saviour.  I also spent hours (days) on this.  Your solution worked perfectly.

                  • Re: Win32_PerfRawData_PerfProc_Process - Invalid Class
                    netlogix

                    I've had the problem a few time and found a shot gun approach works sometimes, here is my notes

                    Shotgun:
                    cd /d %Systemroot%\system32\wbem
                    winmgmt /regserver
                    for %i in (*.dll) do RegSvr32 -s %i
                    for %i in (*.exe) do %i /RegServer
                    wmiadap /f
                    winmgmt.exe /resyncperf
                    winmgmt.exe /verifyrepository
                    for %i in (*.mof, *.mfl) do Mofcomp %i

                    Check Permission and if dcom enabled:
                    dcomcnfg - Properties - Default Properties - enable

                    Try to use windows repair:
                    rundll32 wbemupgd, RepairWMISetup

                    Stuff I had to do for exchange when it stoped working:
                    cd /d "D:\Program Files\exchsrvr\bin"
                    regsvr32 /s cdowf.dll
                    regsvr32 /s exwmi.dll


                    A little more destructive shot gun:
                    winmgmt /clearadap
                    winmgmt /kill
                    winmgmt /unregserver
                    winmgmt /regserver
                    winmgmt /resyncperf
                    wmiadap.exe /f
                    wmiadap.exe /f
                    wmiadap.exe /f
                    wmiadap.exe /f


                    MS debugging tool:
                    cscript c:\Temp\wmidiag\WMIDiag.vbs WriteInRepository=Root

                    • Re: Win32_PerfRawData_PerfProc_Process - Invalid Class
                      aLTeReGo


                      aLTeReGo you're a saviour.  I also spent hours (days) on this.  Your solution worked perfectly.

                       



                       

                      Glad I could help! I'm just sorry you didn't stumble upon this post sooner so you didn't have to spend hours/days troubleshooting like I did.

                    • Re: Win32_PerfRawData_PerfProc_Process - Invalid Class
                      DThorne

                      Thanks!!! ...been looking into this for days and fixed my issue

                      • Re: Win32_PerfRawData_PerfProc_Process - Invalid Class

                        We have had this problem for a while with W2K8 (not R2) and have a alert monitor that triggers if a perfmon based counter is in unknown status and the node is 'up' status without have rebooted in the last 15 minutes.  We pass the ${Node.SysName} is a variable to the script.  This resolves it w/out the reboot and no manual intervention.

                         

                        ' Usage: cscript.exe apm_unknown.vbs %hostname%

                        '==========================================================================

                         

                        strComputer = wscript.arguments.item(0)

                        Set objWMIService = GetObject("winmgmts:" _

                            & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

                         

                        '''WMI RESYNC PERF'''

                         

                              strExe = "winmgmt /resyncperf"

                            Wscript.StdOut.Write strComputer

                         

                            set objWMIService = getobject("winmgmts://"_

                             & strComputer & "/root/cimv2")

                         

                             Set objProcess = objWMIService.Get("Win32_Process")

                             Set objProgram = objProcess.Methods_( _

                             "Create").InParameters.SpawnInstance_

                             objProgram.CommandLine = strExe

                              

                             Set strShell = objWMIService.ExecMethod( _

                             "Win32_Process", "Create", objProgram)

                         

                        '''WMI SALVAGE REPOSITORY'''

                         

                             strExe = "winmgmt /salvagerepository"

                            Wscript.StdOut.Write strComputer

                         

                            set objWMIService = getobject("winmgmts://"_

                             & strComputer & "/root/cimv2")

                         

                             Set objProcess = objWMIService.Get("Win32_Process")

                             Set objProgram = objProcess.Methods_( _

                             "Create").InParameters.SpawnInstance_

                             objProgram.CommandLine = strExe

                              

                             Set strShell = objWMIService.ExecMethod( _

                             "Win32_Process", "Create", objProgram)

                              

                        '''Reload Windows Counters'''

                         

                             strExe = "C:\WINDOWS\SYSTEM32\lodctr /R"

                            Wscript.StdOut.Write strComputer

                         

                            set objWMIService = getobject("winmgmts://"_

                             & strComputer & "/root/cimv2")

                         

                             Set objProcess = objWMIService.Get("Win32_Process")

                             Set objProgram = objProcess.Methods_( _

                             "Create").InParameters.SpawnInstance_

                             objProgram.CommandLine = strExe

                              

                             Set strShell = objWMIService.ExecMethod( _

                             "Win32_Process", "Create", objProgram)

                              

                        Wscript.Sleep 5000     

                              

                        '''ENABLE PERFPROC Performance Counter'''

                         

                        Const HKEY_LOCAL_MACHINE = &H80000002

                        Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _ 

                            strComputer & "\root\default:StdRegProv")

                         

                        strKeyPath = "SYSTEM\CURRENTCONTROLSET\SERVICES\PERFPROC\Performance"

                        strValueName = "Disable Performance Counters"

                        strValue = "0"

                        oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

                         

                        strValueName = "Disable Performance Counters"

                        dwValue = 0

                        oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue

                         

                        '''REMOTE REGISTRY AND DEPENDENTS'''

                         

                        Set colServiceList = objWMIService.ExecQuery("Associators of " _

                            & "{Win32_Service.Name='REMOTEREGISTRY'} Where " _

                                & "AssocClass=Win32_DependentService " & "Role=Antecedent" )

                         

                        For Each objService in colServiceList

                            objService.StopService()

                        Next

                         

                        Wscript.Sleep 5000

                         

                        Set colServiceList = objWMIService.ExecQuery _

                                ("Select * from Win32_Service where Name='REMOTEREGISTRY'")

                        For Each objService in colServiceList

                            errReturn = objService.StopService()

                        Next  

                         

                        WScript.Sleep 10000

                         

                        Set objWMIService = GetObject("winmgmts:" _

                            & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

                         

                        Set colServiceList = objWMIService.ExecQuery _

                            ("Select * from Win32_Service where Name='REMOTEREGISTRY'")

                         

                        For Each objService in colServiceList

                            errReturn = objService.StartService()

                        Next

                         

                        Wscript.Sleep 5000

                         

                        Set colServiceList = objWMIService.ExecQuery _

                            ("Select * from Win32_Service where Name='DFS'")

                         

                        For Each objService in colServiceList

                            errReturn = objService.StartService()

                        Next

                         

                        '''WMI AND DEPENDENTS'''

                         

                        Set colServiceList = objWMIService.ExecQuery("Associators of " _

                            & "{Win32_Service.Name='Winmgmt'} Where " _

                                & "AssocClass=Win32_DependentService " & "Role=Antecedent" )

                         

                        For Each objService in colServiceList

                            objService.StopService()

                        Next

                         

                        Wscript.Sleep 5000

                         

                        Set colServiceList = objWMIService.ExecQuery _

                                ("Select * from Win32_Service where Name='Winmgmt'")

                        For Each objService in colServiceList

                            errReturn = objService.StopService()

                        Next  

                         

                        WScript.Sleep 10000

                         

                        Set objWMIService = GetObject("winmgmts:" _

                            & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

                         

                        Set colServiceList = objWMIService.ExecQuery _

                            ("Select * from Win32_Service where Name='Winmgmt'")

                         

                        For Each objService in colServiceList

                            errReturn = objService.StartService()

                        Next

                         

                        Wscript.Sleep 5000

                         

                        Set colServiceList = objWMIService.ExecQuery _

                            ("Select * from Win32_Service where Name='iphlpsvc'")

                         

                        For Each objService in colServiceList

                            errReturn = objService.StartService()

                        Next

                         

                        WScript.Quit

                        • Re: Win32_PerfRawData_PerfProc_Process - Invalid Class

                          Thank you!!!

                          Heaps of articles did not mention this reg key.

                          The question is though, WHY WAS IT SET?

                          Anybody know?

                            • Re: Win32_PerfRawData_PerfProc_Process - Invalid Class
                              DirtySouth

                              I'm now battling this same issue on one of our Server 2008 boxes. We migrated from a 2k3 server to 2k8 and thats when the WMI monitors stopped working. I've gone through the SolarWinds document and checked all the permissions and reset WMI with the winmgt commands.

                              I looked in the registry for the key mentioned above, but it is not there. Any ideas where it would be?

                                • Re: Win32_PerfRawData_PerfProc_Process - Invalid Class
                                  kreases

                                  I am having the same issue and can't find the key mentioned, did you ever get a fix for this?

                                    • Re: Win32_PerfRawData_PerfProc_Process - Invalid Class
                                      aLTeReGo

                                      Have you tried using the “exctrlst.exe” tool mentioned above?

                                       

                                      If you're unable to find the PerfProc\Performance Registry Key that might be your problem. I recommend exporting and importing this registry key from a known good/working Windows server. Below is an export from mine. Simply copy/paste into Notepad and save it as perfproc.reg. Then copy the file to the affected server, double click on it to import the changes, and then reboot.

                                       

                                      Windows Registry Editor Version 5.00
                                      
                                      
                                      [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\PerfProc\Performance]
                                      "Close"="CloseSysProcessObject"
                                      "Collect"="CollectSysProcessObjectData"
                                      "Collect Timeout"=dword:00001f40
                                      "Library"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,\
                                        74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,70,\
                                        00,65,00,72,00,66,00,70,00,72,00,6f,00,63,00,2e,00,64,00,6c,00,6c,00,00,00
                                      "Object List"="230 232 786 740 816 1408 1500 1548 1760"
                                      "Open"="OpenSysProcessObject"
                                      "Open Timeout"=dword:00002710
                                      "1023"=hex(b):9c,7a,d0,89,14,ab,ce,01
                                      
                                      
                                      1 of 1 people found this helpful
                                • Re: Win32_PerfRawData_PerfProc_Process - Invalid Class
                                  jawapima

                                  Late to the party, I ran into this issue, and your post corrected my client access server's inability to report back to APM. Thanks a million aLTeReGo.

                                  • Re: Win32_PerfRawData_PerfProc_Process - Invalid Class
                                    NMSS NMSS

                                    Thanks for this post, this solved our issues too.  We just restarted WMI service instead of rebooting and that cleared it up.  Appreciate the detail on this.

                                    • Re: Win32_PerfRawData_PerfProc_Process - Invalid Class
                                      ikob

                                      Thanks for the post. It was helpful

                                      • Re: Win32_PerfRawData_PerfProc_Process - Invalid Class
                                        agusst

                                        I was running into this issue as well...I didn't have the reg key that was mentioned as well.  I did notice when I opened Perf Mon I got an error about not being able to load certain counters.  I found the post below which corrected the issue:

                                         

                                        http://answers.microsoft.com/en-us/windows/forum/windows_7-performance/perfmon-problems-unable-to-add-counters/e90f231d-0014-457d-8b1f-5f342971597a

                                         

                                        At the prompt, type lodctr /r and press ENTER. This will repair the pointers (those are stored in the registry).

                                         

                                        Once I corrected the counters, I was able to monitor the system and services correctly again.

                                         

                                        Just wanted to post what I found just incase someone runs into the same issue I had.

                                          • Re: Win32_PerfRawData_PerfProc_Process - Invalid Class
                                            dclick

                                            I am going to bring this up again.

                                             

                                            1. My SAM server (the os) has not changed in over 6 months (other than critical updates).

                                            2. SAM was upgraded to 6.1.1 not to long ago.

                                            3. ALL my WMI/RPC monitors are starting to fail.

                                            4. 3rd party tools, such as the Paessler WMI tester work perfectly.

                                            5. issue has shown itself on Windows 2003, 2008, 2008r2 and 2012.

                                             

                                            I dont think this is an OS issue - but more of a SAM/Solarwinds Problem.  I have a open case, but so far, no solution.

                                              • Re: Win32_PerfRawData_PerfProc_Process - Invalid Class
                                                aLTeReGo

                                                Are you able to query (SELECT * from Win32_PerfRawData_PerfProc_Process where NAME <> '_Total') using the Paessler WMI tester remotely without issue? It does sound like there is something else going on in your environment unrelated to the issue addressed here in this thread. The problem outlined here is specific to process and service monitors. What you are describing appears to be related to Windows Performance Counters. Is that correct? What component monitor types specifically are you having troubles with, and what error messages are you receiving from them?

                                            • Re: Win32_PerfRawData_PerfProc_Process - Invalid Class
                                              trilobite rex

                                              I am getting that invalid class when trying to monitor the Windows Deployment Services Server service.  I don't see a counter to change looking at the registry so anyone have suggestions?

                                              • Re: Win32_PerfRawData_PerfProc_Process - Invalid Class
                                                andresmort

                                                I'm trying to do some monitoring of Windows services on a Windows Server 2008 R2 64-bit server via the tool SolarWinds, in time to add services to the template and perform the test generates the following error:

                                                 

                                                Invalid query

                                                 

                                                 

                                                I conducted a test to Win32_PerfRawData_PerfProc_Process wbemtest.exe class through the Query button with the following instruction:

                                                 

                                                select * from Win32_PerfRawData_PerfProc_Process

                                                 

                                                the following error is generated:

                                                 

                                                Number: 0x80041017

                                                Facility: WMI

                                                Description: Invalid query

                                                 

                                                 

                                                I opened a case and I have received support from Solarwinds through the remote connection to the server. Unfortunately, none of the actions executed was useful in this circumstance.

                                                 

                                                I appreciate the help you can give me to solve the error. Thank you so much.

                                                • Re: Win32_PerfRawData_PerfProc_Process - Invalid Class
                                                  kreases

                                                  As your WMI query failed it could be that your WMI has got corrupted in some way I would suggest trying a repair, I am sure I have done this in the past using powershell but can't remember the exact process but the following link might be a start.

                                                  Use PowerShell to Troubleshoot and Repair WMI Errors | Hey, Scripting Guy! Blog