SYMPTOMDate and Time: 2017/2/16 下午 04:46:07
Log Name: Operations Manager
Source: Health Service Script
Event Number: 4001
Level: 1
Logging Computer:
User: N/A
Description:
Management Group: CDIBOPS. Script: Main Module:
CPUUsagePercentDataSource.ps1 Version: 6.7.15.0 : Error occured during CPU
Usage for SQL Instances data source executing. Computer:HDBSERVER1 Reason:
Cannot add type. There were compilation errors. Position:325 Offset:29 Detailed
error output: Cannot add type. There were compilation errors. -------- (0) : 未指定輸入
(1) : using System; -------- (0) : 找不到原始程式檔
'C:\Windows\TEMP\zsvypltn.0.cs' (1) : using System;
CAUSE
There are some known errors to the 6.6.4.0 version of the SQL
management packs, and one of them does mention “Cannot add type. Compilation
errors occured.”
In a thread on the Technet Forums it was suggested that it has to do with rights, but focusing mainly on the SQL instance. What caught our eyes, however, was the fact that the script is using the
We took a quick look using procmon, filtered on C:\Windows\TEMP\ and yes indeed. The monitoring account used is trying to create and delete its temporary files in that very folder.
In a thread on the Technet Forums it was suggested that it has to do with rights, but focusing mainly on the SQL instance. What caught our eyes, however, was the fact that the script is using the
C:\Windows\TEMP
folder instead of its private one. And this seems to be because it is using a
few .Net components that do some sort of JIT compilation.We took a quick look using procmon, filtered on C:\Windows\TEMP\ and yes indeed. The monitoring account used is trying to create and delete its temporary files in that very folder.
work-around
The work-around is simple, but cumbersome. Just make sure that
the assigned RunAs account have read/write/delete rights on C:\Windows\TEMP.