MECM.Service.MT (UnitMonitorType)

Element properties:

RunAsDefault
AccessibilityPublic
Support Monitor RecalculateTrue

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.Windows.Win32ServiceInformationProvider Default
Probe ProbeAction Microsoft.Windows.Win32ServiceInformationProbe Default
ServiceNotRunning ConditionDetection System.ExpressionFilter Default
ServiceRunning ConditionDetection System.ExpressionFilter Default

Overrideable Parameters:

IDParameterTypeSelector
ServiceNamestring$Config/ServiceName$
IntervalSecondsint$Config/IntervalSeconds$
MatchCountint$Config/MatchCount$

Source Code:

<UnitMonitorType ID="MECM.Service.MT" Accessibility="Public">
<MonitorTypeStates>
<MonitorTypeState ID="Running" NoDetection="false"/>
<MonitorTypeState ID="NotRunning" NoDetection="false"/>
</MonitorTypeStates>
<Configuration>
<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="IntervalSeconds" type="xsd:integer"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="MatchCount" type="xsd:integer"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="ServiceName" Selector="$Config/ServiceName$" ParameterType="string"/>
<OverrideableParameter ID="IntervalSeconds" Selector="$Config/IntervalSeconds$" ParameterType="int"/>
<OverrideableParameter ID="MatchCount" Selector="$Config/MatchCount$" ParameterType="int"/>
</OverrideableParameters>
<MonitorImplementation>
<MemberModules>
<DataSource ID="DS" TypeID="Windows!Microsoft.Windows.Win32ServiceInformationProvider">
<ComputerName>$Config/ComputerName$</ComputerName>
<ServiceName>$Config/ServiceName$</ServiceName>
<Frequency>$Config/IntervalSeconds$</Frequency>
<DisableCaching>true</DisableCaching>
<CheckStartupType>true</CheckStartupType>
</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>
<Or>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Integer">Property[@Name='StartMode']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="Integer">4</Value>
<!-- 0=BootStart 1=SystemStart 2=Automatic 3=Manual 4=Disabled -->
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Integer">Property[@Name='State']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="Integer">4</Value>
<!-- 0=Unknown 1=Stopped 2=StartPending 3=StopPending 4=Running 5=ContinuePending 6=PausePending 7=Paused 8=ServiceNotFound 9=ServerNotFound -->
</ValueExpression>
</SimpleExpression>
</Expression>
</Or>
</Expression>
</ConditionDetection>
<ConditionDetection ID="ServiceNotRunning" TypeID="System!System.ExpressionFilter">
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Integer">Property[@Name='StartMode']</XPathQuery>
</ValueExpression>
<Operator>NotEqual</Operator>
<ValueExpression>
<Value Type="Integer">4</Value>
<!-- 0=BootStart 1=SystemStart 2=Automatic 3=Manual 4=Disabled -->
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Integer">Property[@Name='State']</XPathQuery>
</ValueExpression>
<Operator>NotEqual</Operator>
<ValueExpression>
<Value Type="Integer">4</Value>
<!-- 0=Unknown 1=Stopped 2=StartPending 3=StopPending 4=Running 5=ContinuePending 6=PausePending 7=Paused 8=ServiceNotFound 9=ServerNotFound -->
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
<SuppressionSettings>
<MatchCount>$Config/MatchCount$</MatchCount>
</SuppressionSettings>
</ConditionDetection>
</MemberModules>
<RegularDetections>
<RegularDetection MonitorTypeStateID="Running">
<Node ID="ServiceRunning">
<Node ID="DS"/>
</Node>
</RegularDetection>
<RegularDetection MonitorTypeStateID="NotRunning">
<Node ID="ServiceNotRunning">
<Node ID="DS"/>
</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>