Problem:
Alert: message is Variable not defined ‘EVENT_TYPE_ERROR’ C:\Program Files\Microsoft Monitoring Agent\Agent\Health Service State\Monitoring Host Temporary Files 104\4529\SQLAgentJobDiscovery.vbs(293, 9) Microsoft VBScript runtime error: Variable is undefined: ‘EVENT_TYPE_ERROR’
Reason:
The variable is really not defined inside the management pack and Option Explicit is set so variables must be defined. (ManagamentPack Bug). As the variable is only used if Access is denied the error is not allways showing up.
Else If DoJobDiscovery(ServiceName, InstanceName, ConnectionString, oSQLDiscoveryData, TcpPort) < 0 Then
oAPI.LogScriptEvent “SQLAgentJobDiscovery:” & InstanceName, SCRIPT_EVENT_ID, EVENT_TYPE_ERROR, “SQL Agent Job for SQL instance ‘” + InstanceName + “‘ discovery failed.” End If End If
Solution:
Fix the management Pack Microsoft.SQLServer.2012.Discovery Or Fix the reason the discovery cant read the jobs in your SQL DB. Give the runas account rights or add sysadmin right to NT Authority\system as it was before on SQL 2008.