MSSQL 2016: Always On 모니터링 스크립트 실패 규칙

Microsoft.SQLServer.2016.AlwaysOn.ScriptFailedRule (Rule)

이 규칙은 이벤트 ID 4212를 검색하고 알림을 만듭니다.

Knowledge Base article:

요약

Always On 스크립트 실패 이벤트 검색 규칙

원인

계속으로 처리되지 않는 cmdlet 호출의 예외뿐만 아니라 스크립트 내의 예외로 인해 스크립트 실행이 실패할 수 있습니다.

해결 방법

경고 설명 및 컨텍스트에 실패한 규칙이나 모니터를 나타내는 정보가 있습니다.

재정의 가능한 매개 변수

이름

설명

기본값

사용

워크플로를 사용하거나 사용하지 않도록 설정합니다.

우선 순위

알림 우선 순위를 정의합니다.

1

심각도

알림 심각도를 정의합니다.

2

Element properties:

TargetMicrosoft.SQLServer.2016.AlwaysOn.AlwaysOnSeed
CategoryAlert
EnabledTrue
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
RemotableTrue
Alert Message
MSSQL 2016: Always On 모니터링 스크립트 실패
Always On 모니터링 스크립트가 실패했습니다. 이유: {0}
Event LogOperations Manager

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.Windows.EventProvider Default
Alert WriteAction System.Health.GenerateAlert Default

Source Code:

<Rule ID="Microsoft.SQLServer.2016.AlwaysOn.ScriptFailedRule" Enabled="true" Target="Microsoft.SQLServer.2016.AlwaysOn.AlwaysOnSeed" ConfirmDelivery="true" Remotable="true" Priority="Normal">
<Category>Alert</Category>
<DataSources>
<DataSource ID="DS" TypeID="Windows!Microsoft.Windows.EventProvider">
<ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</ComputerName>
<LogName>Operations Manager</LogName>
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="UnsignedInteger">EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="UnsignedInteger">4212</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="UnsignedInteger">EventLevel</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="UnsignedInteger">1</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<RegExExpression>
<ValueExpression>
<XPathQuery>Params/Param[1]</XPathQuery>
</ValueExpression>
<Operator>ContainsSubstring</Operator>
<Pattern>Management Group: $Target/ManagementGroup/Name$.</Pattern>
</RegExExpression>
</Expression>
</And>
</Expression>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="Alert" TypeID="Health!System.Health.GenerateAlert">
<Priority>1</Priority>
<Severity>2</Severity>
<AlertOwner/>
<AlertMessageId>$MPElement[Name="Microsoft.SQLServer.2016.AlwaysOn.ScriptFailedRule.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>Event ID: $Data/EventDisplayNumber$. $Data/EventDescription$</AlertParameter1>
</AlertParameters>
<Suppression>
<SuppressionValue/>
</Suppression>
</WriteAction>
</WriteActions>
</Rule>