HealthService Connect to SQL Monitor

Microsoft.SQLServer.RunAs.2014.Addendum.OLEDB.ConnectionCheck.Monitor (UnitMonitor)

Knowledge Base article:

Summary

This monitor checks that the SCOM agent can connect to SQL via an OLEDB probe.

If this monitor is unhealthy, it means that the "NT Service\HealthService" SID is not configured as a login on the SQL server.

Causes

This monitor uses the System.OleDbProbe and attempts to run a test query. If the probe cannot connect to SQL it returns a "HRResult" with a negative value, and sets the monitor to Unhealthy.

Resolutions

Run one of the following tasks:

Create HealthService Login as SA Role SQL 20xx

Create HealthService Login as Low Priv in SQL 20xx

To create a login on the SQL server and apply the permissions per your requirements. You can grant the NT SERVICE\Healthservice to have the SysAdmin role, or you can grant lowest priv per the MP guide.

External

https://blogs.technet.microsoft.com/kevinholman/2016/08/25/sql-mp-run-as-accounts-no-longer-required-2/

Element properties:

TargetMicrosoft.SQLServer.2014.DBEngine
Parent MonitorSystem.Health.ConfigurationState
CategoryCustom
EnabledTrue
Alert GenerateFalse
Alert Auto ResolveFalse
Monitor TypeMicrosoft.SQLServer.RunAs.2014.Addendum.OLEDB.ConnectionCheck.MonitorType
RemotableTrue
AccessibilityPublic
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.RunAs.2014.Addendum.OLEDB.ConnectionCheck.Monitor" Accessibility="Public" Enabled="true" Target="SQL2014Disc!Microsoft.SQLServer.2014.DBEngine" ParentMonitorID="Health!System.Health.ConfigurationState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.RunAs.2014.Addendum.OLEDB.ConnectionCheck.MonitorType" ConfirmDelivery="false">
<Category>Custom</Category>
<OperationalStates>
<OperationalState ID="OK" MonitorTypeStateID="ConnectionGood" HealthState="Success"/>
<OperationalState ID="Error" MonitorTypeStateID="ConnectionBad" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>14451</IntervalSeconds>
<ConnectionString>$Target/Property[Type="SQL2014Disc!Microsoft.SQLServer.2014.DBEngine"]/ConnectionString$</ConnectionString>
</Configuration>
</UnitMonitor>