MSSQL 2016: Server の Windows サービス

Microsoft.SQLServer.2016.CheckWinServiceStateMonitorType (UnitMonitorType)

SQL Server の Windows サービスの検出状態に関するモニターの種類。

Element properties:

RunAsMicrosoft.SQLServer.MonitoringAccount
AccessibilityInternal
Support Monitor RecalculateFalse

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.Windows.WmiProvider Default
CheckServiceState ProbeAction Microsoft.SQLServer.2016.VerifyWindowsServiceState Default
ServiceNotRunning ConditionDetection System.ExpressionFilter Default
ServiceRunning ConditionDetection System.ExpressionFilter Default

Overrideable Parameters:

IDParameterTypeSelectorDisplay NameDescription
Frequencyint$Config/Frequency$間隔 (秒)ワークフローを実行する定期的な実行間隔 (秒)。
CheckStartupTypestring$Config/CheckStartupType$サービスのスタートアップの種類が [自動] の場合にのみ通知この値は、'true' または 'false' にのみ設定できます。このパラメーターが ‘false’ に設定されている場合、ワークフローは、サービスのスタートアップの種類に関する現在の設定を考慮に入れません。既定値は 'true' です。
UnavailableTimeint$Config/UnavailableTime$使用できない時間 (秒)サービスが利用不可になってから異常であると判断されるまでの最小期間。

Source Code:

<UnitMonitorType ID="Microsoft.SQLServer.2016.CheckWinServiceStateMonitorType" Accessibility="Internal" RunAs="GPMP!Microsoft.SQLServer.MonitoringAccount">
<MonitorTypeStates>
<MonitorTypeState ID="Running" NoDetection="false"/>
<MonitorTypeState ID="NotRunning" NoDetection="false"/>
</MonitorTypeStates>
<Configuration>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Frequency" type="xsd:integer"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ComputerName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ServiceName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="CheckStartupType" minOccurs="0" maxOccurs="1" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="UnavailableTime" type="xsd:integer"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="Frequency" Selector="$Config/Frequency$" ParameterType="int"/>
<OverrideableParameter ID="CheckStartupType" Selector="$Config/CheckStartupType$" ParameterType="string"/>
<OverrideableParameter ID="UnavailableTime" Selector="$Config/UnavailableTime$" ParameterType="int"/>
</OverrideableParameters>
<MonitorImplementation>
<MemberModules>
<DataSource ID="DS" TypeID="Windows!Microsoft.Windows.WmiProvider">
<NameSpace>\\.\Root\cimv2</NameSpace>
<Query>SELECT StartMode, State FROM Win32_Service WHERE Name = '$Config/ServiceName$'</Query>
<Frequency>$Config/Frequency$</Frequency>
</DataSource>
<ProbeAction ID="CheckServiceState" TypeID="Microsoft.SQLServer.2016.VerifyWindowsServiceState">
<ServiceName>$Config/ServiceName$</ServiceName>
<ServiceUnavailableTime>$Config/UnavailableTime$</ServiceUnavailableTime>
<CheckStartupType>$Config/CheckStartupType$</CheckStartupType>
<StartMode>$Data/Property[@Name='StartMode']$</StartMode>
<State>$Data/Property[@Name='State']$</State>
</ProbeAction>
<ConditionDetection ID="ServiceRunning" TypeID="System!System.ExpressionFilter">
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='ServiceState']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">Running</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</ConditionDetection>
<ConditionDetection ID="ServiceNotRunning" TypeID="System!System.ExpressionFilter">
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='ServiceState']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">NotRunning</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</ConditionDetection>
</MemberModules>
<RegularDetections>
<RegularDetection MonitorTypeStateID="Running">
<Node ID="ServiceRunning">
<Node ID="CheckServiceState">
<Node ID="DS"/>
</Node>
</Node>
</RegularDetection>
<RegularDetection MonitorTypeStateID="NotRunning">
<Node ID="ServiceNotRunning">
<Node ID="CheckServiceState">
<Node ID="DS"/>
</Node>
</Node>
</RegularDetection>
</RegularDetections>
</MonitorImplementation>
</UnitMonitorType>