具有連續取樣閾值監視類型的 Windows 服務並未執行狀態

Microsoft.SystemCenter.2007.WindowsServiceNotRunningState.ConsecutiveSamplesThreshold.MonitorType (UnitMonitorType)

此監視類型使用取樣計數閾值來提供檢查 Windows 服務狀態的能力。

Element properties:

RunAsDefault
AccessibilityPublic
Support Monitor RecalculateTrue

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource System.Scheduler Default
Probe ProbeAction Microsoft.Windows.Win32ServiceInformationProbe Default
CD1 ConditionDetection System.Performance.ConsecutiveSamplesCondition Default
CDSufficientSamples ConditionDetection System.ExpressionFilter Default
Mapper ConditionDetection System.Performance.DataGenericMapper Default
ServiceNotRunning ConditionDetection System.ExpressionFilter Default
ServiceRunning ConditionDetection System.ExpressionFilter Default

Overrideable Parameters:

IDParameterTypeSelectorDisplay NameDescription
IntervalSecondsint$Config/IntervalSeconds$間隔秒數檢查服務狀態的間隔 (以秒為單位)。
Thresholddouble$Config/Threshold$閾值等待監視變更為並未執行狀態的取樣計數。

Source Code:

<UnitMonitorType ID="Microsoft.SystemCenter.2007.WindowsServiceNotRunningState.ConsecutiveSamplesThreshold.MonitorType" Accessibility="Public">
<MonitorTypeStates>
<MonitorTypeState ID="NotRunning"/>
<MonitorTypeState ID="Running"/>
</MonitorTypeStates>
<Configuration>
<xsd:element name="ComputerName" type="xsd:string"/>
<xsd:element name="ServiceName" type="xsd:string"/>
<xsd:element name="IntervalSeconds" type="xsd:integer"/>
<xsd:element minOccurs="1" name="Threshold" type="xsd:double"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="IntervalSeconds" Selector="$Config/IntervalSeconds$" ParameterType="int"/>
<OverrideableParameter ID="Threshold" Selector="$Config/Threshold$" ParameterType="double"/>
</OverrideableParameters>
<MonitorImplementation>
<MemberModules>
<DataSource ID="DS" TypeID="System!System.Scheduler">
<Scheduler>
<SimpleReccuringSchedule>
<Interval>$Config/IntervalSeconds$</Interval>
<SyncTime/>
</SimpleReccuringSchedule>
<ExcludeDates/>
</Scheduler>
</DataSource>
<ProbeAction ID="Probe" TypeID="Windows!Microsoft.Windows.Win32ServiceInformationProbe">
<ComputerName>$Config/ComputerName$</ComputerName>
<ServiceName>$Config/ServiceName$</ServiceName>
</ProbeAction>
<ConditionDetection ID="ServiceRunning" TypeID="System!System.ExpressionFilter">
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Integer">Property[@Name='State']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="Integer">4</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</ConditionDetection>
<ConditionDetection ID="ServiceNotRunning" TypeID="System!System.ExpressionFilter">
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Integer">Property[@Name='State']</XPathQuery>
</ValueExpression>
<Operator>NotEqual</Operator>
<ValueExpression>
<Value Type="Integer">4</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</ConditionDetection>
<ConditionDetection ID="Mapper" TypeID="Performance!System.Performance.DataGenericMapper">
<ObjectName>WindowsService</ObjectName>
<CounterName>ServiceState</CounterName>
<InstanceName>$Config/ServiceName$</InstanceName>
<Value>1</Value>
</ConditionDetection>
<ConditionDetection ID="CD1" TypeID="Performance!System.Performance.ConsecutiveSamplesCondition">
<Threshold>1</Threshold>
<Direction>greaterequal</Direction>
</ConditionDetection>
<ConditionDetection ID="CDSufficientSamples" TypeID="System!System.ExpressionFilter">
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Double">Value</XPathQuery>
</ValueExpression>
<Operator>GreaterEqual</Operator>
<ValueExpression>
<Value Type="Double">$Config/Threshold$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</ConditionDetection>
</MemberModules>
<RegularDetections>
<RegularDetection MonitorTypeStateID="Running">
<Node ID="ServiceRunning">
<Node ID="Probe">
<Node ID="DS"/>
</Node>
</Node>
</RegularDetection>
<RegularDetection MonitorTypeStateID="NotRunning">
<Node ID="CDSufficientSamples">
<Node ID="CD1">
<Node ID="Mapper">
<Node ID="ServiceNotRunning">
<Node ID="Probe">
<Node ID="DS"/>
</Node>
</Node>
</Node>
</Node>
</Node>
</RegularDetection>
</RegularDetections>
<OnDemandDetections>
<OnDemandDetection MonitorTypeStateID="Running">
<Node ID="ServiceRunning">
<Node ID="Probe"/>
</Node>
</OnDemandDetection>
<OnDemandDetection MonitorTypeStateID="NotRunning">
<Node ID="ServiceNotRunning">
<Node ID="Probe"/>
</Node>
</OnDemandDetection>
</OnDemandDetections>
</MonitorImplementation>
</UnitMonitorType>