locked
Getting Monitoring failed and discovery failed alerts for SQL server RRS feed

  • Question

  • Hi Guys,

    Getting Monitoring failed and discovery failed alerts for SQL servers. Please suggest a action here. Below are the alerts which are coming. It seems related to WMI query

    Event ID: 4001. Management Group: . Script: DiscoverSQL2008DBEngineDiscovery.vbs. Version: 7.0.4.0 : 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

    Event ID: 7104. Management Group: . Script: DiscoverSQL2014MirroringWitness.vbs. Version: 7.0.4.0. Instance: RSA : Mirroring witness discovery script 'DiscoverSQL2014MirroringWitness.vbs' for instance 'RSA' failed.
    The next errors occurred:
    Query execution failed: [Microsoft][SQL Server Native Client 11.0][SQL Server]The SELECT permission was denied on the object 'database_mirroring_witnesses', database 'mssqlsystemresource', schema 'sys'.


    AD

    Friday, August 10, 2018 8:31 AM

Answers

  • First alert shows that your SQL WMI provider is probably broken or missing.

    You can restore it using mofcomp :

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

    Run mofcomp sqlmgmproviderxpsp2up.mof

    Second alert likely shows that the run as account you are using doesn't have proper permissions inside SQL instance, or that you did not setup a run as account at all.


    Friday, August 10, 2018 8:54 AM

All replies

  • First alert shows that your SQL WMI provider is probably broken or missing.

    You can restore it using mofcomp :

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

    Run mofcomp sqlmgmproviderxpsp2up.mof

    Second alert likely shows that the run as account you are using doesn't have proper permissions inside SQL instance, or that you did not setup a run as account at all.


    Friday, August 10, 2018 8:54 AM
  • Hi,

    Agree with CyrAz, it's an option to re-compile the .mof (Managed Object Format) extension. 

    The path is as following and varies from SQL version to version:
    Open an evaluated command prompt (run-as administrator) and run:

    cd %programfiles(x86)%\Microsoft SQL Server\120\Shared
    mofcomp sqlmgmproviderxpsp2up.mof
    Note: the value could be: 100 (SQL2008) or 110 (SQL2012) or 120 (SQL2014) or 130 (SQL2016)

    Hope the above information helps.

    -----------------------------------------------

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, August 13, 2018 2:52 AM
  • Hey,

    were yoiu abel to test the suggestions of CyrAz and Alex? We really appreciate your feedback!

    Thanks in advance!

    Regards,


    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer" where applicable. This helps the community, keeps the forums tidy, and recognizes useful contributions. Thanks!) Blog: https://blog.pohn.ch/ Twitter: @StoyanChalakov

    Thursday, August 23, 2018 11:08 AM
  • It worked for me!

    If you see "Invalid class", then just try to re-compile the .mof extension for that version.

    THANK YOU!

    Friday, July 26, 2019 10:25 AM