Event 4211 on SQL Sever 2016 (MSSQL 2016: Monitoring failed)

So today I installed a new SCOM Environment and immediately after installing the SQL 2016 Management Pack the event log was littered with 4211 Errors and triggered the Alert Rule: MSSQL 2016: Monitoring failed.

In the Operations Manager Event Log there was a lot of varied 4211 errors.

Event 4211

 

 

An example of one such error is below:

 

Management Group: CulhamLab. Script: Main Module: CPUUsagePercentDataSource.ps1 Version: 6.7.20.0 :
Error occured during CPU Usage for SQL Instances data source executing.
Computer:SQL01
Reason: Cannot add type. Compilation errors occurred.
Position:319
Offset:21
Detailed error output: Cannot add type. Compilation errors occurred.
——–
(0) : Source file ‘C:\Windows\TEMP\hiknxpbv.0.cs’ could not be found

(1) : using System;

——–
Requested registry access is not allowed.

 

One thing every one of them had in common was the part I’ve highlighted in Bold Text. They are trying to write to C:\Windows\Temp folder and the Run As account doesn’t have the required permissions to do so.

So obviously the solution is to give the Run As account you’re using for monitoring SQL Server permissions to write to this folder. So perform the following steps:

  1. Open Windows Explorer and navigate to C:\Windows.
  2. Right click on the Temp folder and choose “Properties”.
  3. Choose the “Security” Tab then click the “Edit” button.
  4. Click “Add” and enter in the name of your Run As account and click “Check Names”. Click “OK”.
  5. In the Permissions window grant delete, read and write permissions to this account or give it “Full Control”. Click “OK” and “OK” again.

 

The issue should now be resolved.

 
Comments

Hi Tim,

you should receive alerts in SCOM as well regarding Monitoring failed/warning. I guess since 6.4.0.0 for all SQL MPs the change was made and documented in the MP Guide when using RunAs accounts. You need to grant read permission in the registry for the Parameters key for every instance, too.

Regards
Konstantin

Hi Konstantin,
Yes it always pays to read the documentation 🙂

Leave a Reply