Unable to Monitor Analysis Services Servers

事件類型:       警告
事件來源:       Health Service Modules
事件類別目錄:       無
事件識別碼:   21406
描述:
The process started at 下午 00:00:00 failed to create System.Discovery.Data. Errors found in output:
C:\Program Files\System Center Operations Manager 2007\Health Service State\Monitoring Host Temporary Files 4\710\DiscoverSQL2005ASDiscovery.vbs(944, 11) Microsoft VBScript runtime error: Type mismatch: '[string: ""]'
Command executed:       "C:\WINDOWS\system32\cscript.exe" /nologo "DiscoverSQL2005ASDiscovery.vbs" {AAD43FAE-0F82-0499-51E1-B30B1344AF93} {B499003B-DC85-0A30-E227-478D01D4BF78} jimmyscom.123.tw jimmyscom.123.tw
Working Directory:  C:\Program Files\System Center Operations Manager 2007\Health Service State\Monitoring Host Temporary Files 4\710\
One or more workflows were affected by this. 
Workflow name: Microsoft.SQLServer.2005.AnalysisServicesDiscoveryRule.Server
Instance name: jimmyscom.123.tw
Instance ID: {12345444-0A30-E227-478D01D4BF78}
Management group: Jimmytest
請在 <https://go.microsoft.com/fwlink/events.asp> 查看說明及支援中心,以取得其他資訊。

Root Cause :
==========
- SQL Management Pack version no 6.0.6460.0 DiscoverSQL2005ASDiscovery.vbs was having issues.

Resolution :
============
The name of the two scripts are as follows:
Analysis Services: DiscoverSQL2005ASDiscovery.vbs
Reporting Services: DiscoverSQL2005RSDiscovery.vbs
The files are stored in the folder structure inside the Health Service State directory, so you'll need to perform a search (Windows Search or by running a dir /s /a /b from a command prompt) against the Health Service State directory eg. C:\Program Files\System Center Operations Manager 2007\Health Service State
Once you've located the files, open them for editing
Locate the following block of code, it's located near line 1343 for AS, and near line 1256 for RS:

Public Function GetSQLServiceName(sInstance)
If sInstance = SQL_DEFAULT Then
GetSQLServiceName = SQL_DEFAULT
Else
GetSQLServiceName = "MSSQL$" & sInstance
End If
End Function
Modify the highlighted code above as follows for each script:
Analysis Services:
Public Function GetSQLServiceName(sInstance)
If sInstance = SQL_DEFAULT Then
GetSQLServiceName = "MSSQLServerOLAPService"
Else
GetSQLServiceName = "MSOLAP$" & sInstance
End If
End Function
Reporting Services:
Public Function GetSQLServiceName(sInstance)
If sInstance = SQL_DEFAULT Then
GetSQLServiceName = "ReportServer"
Else
GetSQLServiceName = "ReportServer$" & sInstance
End If
End Function

Now that the scripts have been updated, make sure not to restart the health service on this server, otherwise the script will be overwritten with the original version from the MP. This is one of the limitations of the workaround, as we aren't updating the script at the source (in the MP), so any time the health service is restarted, it will update it's configuration and check all files to make sure they
match, and if they don't it will overwrite them.