none
SQL 2008 R2 Discovery issue RRS feed

  • Question

  • Good morning. I am getting an error that has many posts throughout many forums, and most tend to reccomend following the SQL MP Guide, and troubleshooting permissions. I assure you that this has been done (and agents reinstalled, MP's re-downloaded, permissions verified etc).

    We have multiple SQL deployments, but only this server seems to have a problem.

    Some info:

    SCOM 2012 7.0.8560.0

    SQL MP 6.3.173.1

    Server OS is Server 2008 R2 (for SCOM servers and SQL Servers).

    SQL Servers are all patched to SQL 2008 R2 SP2 level.

    under the Microsoft SQL Computers view in SCOM 2012, I see my server with a green tick, but there are no green ticks under the SQL DB columns

    The error is around discovery. Event 4001

    DiscoverSQL2008DBEngineDiscovery.vbs : The Query 'select * from SqlService where SQLServiceType ='1'' did not return any valid instances.  Please check to see if this is a valid WMI Query.. Invalid class

    As you can see, It appears I have an Invalid Class. I have rebuilt WMI, and re-registered DLLS etc as per http://blogs.technet.com/b/askperf/archive/2009/04/13/wmi-rebuilding-the-wmi-repository.aspx

    I have also run wmimgmt.msc and compared the hierachy and permissions between two SQL Servers. Both are the same (RUNAS Account has local admin rights to the Server, and full control to WMI. Both the working server and problem server have a hierachy ROOT -> Microsoft -> SqlServer)

    So I'm not convinced I have a permissions error, or a corrupt WMI either.

    To add to my confusion, I cannot find the VBS Script anywhere. DiscoverSQL2008DBEngineDiscovery.VBS can't be found on either of my SCOM Management Servers, or any of the SQL Servers that are being monitored! I wanted to look at this file and try run it manually, but why is it not anywhere to be found in my environment?

    The folder \5985\ shown in the Event Log does not exist either:

    C:\Program Files\System Center Operations Manager\Agent\Health Service State\Monitoring Host Temporary Files 32\5985\

    On a working SQL Server, the only SQL scripts I can find are "GetSQLDB.VBS", "GetSQL2008DBFilesFreeSpace.VBS", "GetSQL2008DBFreeSpace.VBS", "GetSQL2008DBFilesFreeSpace.VBS"

    So I'm really battling to find new things to try. Either

    1) the Discovery VBS files have vanished??

    2) I have a WMI Issue (but I'd like to test the VBS Files and see what its doing)

    3) I have a permissions issue (although the discovery account instructions were followed, has local admin and SQL admin rights and can browse\query SQL freely)

    Any ideas?

    Carl


    • Edited by Carl.T Friday, February 1, 2013 7:12 AM
    Friday, February 1, 2013 7:09 AM

Answers

  • Hi, I set up another SQL 2008 R2 Server on Windows Server 2008 R2, configured it with service accounts etc etc and I had the SAME issue!

    I'm not sure if its perhaps the SQL Media that I'm using, but at least I now have a Server I can troubleshoot on without risking breaking our production environment.

    I tried using the windows account that i set up the Server and SQL with for SCOM discover\monitoring... so there was definately not a permissions error, yet I still received the WMI "Invalid Class" error.

    After much searching, the problem has been found.

    From a command prompt, browse to the folder “C:\Program Files (x86)\Microsoft SQL Server\100\Shared”

    Run mofcomp sqlmgmproviderxpsp2up.mof

    This registers the MOF data in the Repository (which i would have thought would happen at the time of installation?)

    Restart your SCOM Agent on the server. Problem solved.

    I have no idea, why this needed to be done after a fresh install. I assume some sort of bug.

    Hope this helps other people that come across this.

    Cheers

    • Marked as answer by Carl.T Monday, February 4, 2013 12:24 PM
    Monday, February 4, 2013 12:23 PM

All replies

  • Hi,

    You can verify you situation via the following article:

    http://blogs.technet.com/b/kevinholman/archive/2010/03/09/basic-troubleshooting-of-discovery-scripts.aspx

    it shows how to find the .vbs file in the health service state folder.


    Alex Zhao
    TechNet Community Support

    Monday, February 4, 2013 9:13 AM
    Moderator
  • Hi, I set up another SQL 2008 R2 Server on Windows Server 2008 R2, configured it with service accounts etc etc and I had the SAME issue!

    I'm not sure if its perhaps the SQL Media that I'm using, but at least I now have a Server I can troubleshoot on without risking breaking our production environment.

    I tried using the windows account that i set up the Server and SQL with for SCOM discover\monitoring... so there was definately not a permissions error, yet I still received the WMI "Invalid Class" error.

    After much searching, the problem has been found.

    From a command prompt, browse to the folder “C:\Program Files (x86)\Microsoft SQL Server\100\Shared”

    Run mofcomp sqlmgmproviderxpsp2up.mof

    This registers the MOF data in the Repository (which i would have thought would happen at the time of installation?)

    Restart your SCOM Agent on the server. Problem solved.

    I have no idea, why this needed to be done after a fresh install. I assume some sort of bug.

    Hope this helps other people that come across this.

    Cheers

    • Marked as answer by Carl.T Monday, February 4, 2013 12:24 PM
    Monday, February 4, 2013 12:23 PM
  • Work perfectly here.  Thanks!
    Wednesday, May 8, 2013 2:52 PM
  • Great post.  Thank you for sharing your fix!
    Monday, November 11, 2013 9:14 PM