MSSQL 2014: AlwaysOn 検出スクリプト失敗ルール

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

このルールはイベント ID 4202 を検出して警告を作成します

Knowledge Base article:

概要

AlwaysOn スクリプト失敗イベント検出ルール

原因

スクリプトの実行に失敗する原因としては、スクリプト内の例外や、継続として処理されないコマンドレット呼び出しの例外があります。

解決方法

アラートの説明およびコンテキストには、失敗したルールまたはモニターを示す情報が含まれます。

上書き可能なパラメーター

名前

説明

既定値

有効

 

はい

アラートを生成する

 

はい

優先度

 

1

重要度

 

2

Element properties:

TargetMicrosoft.SQLServer.2014.AlwaysOn.AlwaysOnSeed
CategoryAlert
EnabledTrue
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
RemotableTrue
Alert Message
MSSQL2014: AlwaysOn 検出スクリプト失敗
AlwaysOn 検出スクリプトは失敗しました。理由: {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.2014.AlwaysOn.ScriptFailedRule" Enabled="true" Target="Microsoft.SQLServer.2014.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">4202</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="UnsignedInteger">EventLevel</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="UnsignedInteger">2</Value>
</ValueExpression>
</SimpleExpression>
</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.2014.AlwaysOn.ScriptFailedRule.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>$Data/EventDescription$</AlertParameter1>
</AlertParameters>
<Suppression>
<SuppressionValue/>
</Suppression>
</WriteAction>
</WriteActions>
</Rule>