Estado de no ejecución de un servicio de Windows con un tipo de monitor de muestras consecutivas en umbral

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

Este tipo de monitor permite comprobar el estado de un servicio de Windows mediante el uso de un umbral de recuento de muestras.

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$Intervalo (segundos)Intervalo en segundos en el que se comprueba el estado del servicio.
Thresholddouble$Config/Threshold$UmbralRecuento de muestras que deberán contarse antes de que el monitor pase a un estado de no ejecución.

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>