MSSQL 2012: служба Windows сервера

Microsoft.SQLServer.2012.CheckWinServiceStateMonitorType (UnitMonitorType)

Этот тип монитора используется для обнаружения состояния службы Windows SQL Server.

Element properties:

RunAsMicrosoft.SQLServer.SQLProbeAccount
AccessibilityInternal
Support Monitor RecalculateFalse

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.Windows.WmiProvider Default
CheckServiceState ProbeAction Microsoft.SQLServer.2012.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.2012.CheckWinServiceStateMonitorType" Accessibility="Internal" RunAs="SQL!Microsoft.SQLServer.SQLProbeAccount">
<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.2012.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>