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.
An example of one such error is below:
Management Group: CulhamLab. Script: Main Module: CPUUsagePercentDataSource.ps1 Version: 184.108.40.206 :
Error occured during CPU Usage for SQL Instances data source executing.
Reason: Cannot add type. Compilation errors occurred.
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:
- Open Windows Explorer and navigate to C:\Windows.
- Right click on the Temp folder and choose “Properties”.
- Choose the “Security” Tab then click the “Edit” button.
- Click “Add” and enter in the name of your Run As account and click “Check Names”. Click “OK”.
- 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.