简单阈值

Microsoft.Windows.WmiBased.Performance.ThresholdMonitorType (UnitMonitorType)

使用单个阈值的 WMI 阈值监视器

Element properties:

RunAsDefault
AccessibilityPublic
Support Monitor RecalculateFalse

Member Modules:

ID Module Type TypeId RunAs 
DataSource DataSource Microsoft.Windows.WmiPerfCounterProvider Default
OverThresholdFilter ConditionDetection System.ExpressionFilter Default
UnderThresholdFilter ConditionDetection System.ExpressionFilter Default

Overrideable Parameters:

IDParameterTypeSelector
Frequencyint$Config/Frequency$
Thresholdstring$Config/Threshold$阈值

Source Code:

<UnitMonitorType ID="Microsoft.Windows.WmiBased.Performance.ThresholdMonitorType" Accessibility="Public">
<MonitorTypeStates>
<MonitorTypeState ID="UnderThreshold"/>
<MonitorTypeState ID="OverThreshold"/>
</MonitorTypeStates>
<Configuration>
<xsd:element name="NameSpace" type="xsd:string"/>
<xsd:element name="Query" type="xsd:string"/>
<xsd:element name="Frequency" type="xsd:unsignedInt"/>
<xsd:element name="ObjectName" type="xsd:string"/>
<xsd:element name="CounterName" type="xsd:string"/>
<xsd:element name="InstanceName" type="xsd:string"/>
<xsd:element name="Value" type="xsd:string"/>
<xsd:element name="Threshold" type="xsd:string"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="Frequency" Selector="$Config/Frequency$" ParameterType="int"/>
<OverrideableParameter ID="Threshold" Selector="$Config/Threshold$" ParameterType="string"/>
</OverrideableParameters>
<MonitorImplementation>
<MemberModules>
<DataSource ID="DataSource" TypeID="Microsoft.Windows.WmiPerfCounterProvider">
<NameSpace>$Config/NameSpace$</NameSpace>
<Query>$Config/Query$</Query>
<Frequency>$Config/Frequency$</Frequency>
<ObjectName>$Config/ObjectName$</ObjectName>
<CounterName>$Config/CounterName$</CounterName>
<InstanceName>$Config/InstanceName$</InstanceName>
<Value>$Config/Value$</Value>
</DataSource>
<ConditionDetection ID="UnderThresholdFilter" TypeID="System!System.ExpressionFilter">
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Double">Value</XPathQuery>
</ValueExpression>
<Operator>LessEqual</Operator>
<ValueExpression>
<Value Type="Double">$Config/Threshold$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</ConditionDetection>
<ConditionDetection ID="OverThresholdFilter" TypeID="System!System.ExpressionFilter">
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Double">Value</XPathQuery>
</ValueExpression>
<Operator>Greater</Operator>
<ValueExpression>
<Value Type="Double">$Config/Threshold$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</ConditionDetection>
</MemberModules>
<RegularDetections>
<RegularDetection MonitorTypeStateID="UnderThreshold">
<Node ID="UnderThresholdFilter">
<Node ID="DataSource"/>
</Node>
</RegularDetection>
<RegularDetection MonitorTypeStateID="OverThreshold">
<Node ID="OverThresholdFilter">
<Node ID="DataSource"/>
</Node>
</RegularDetection>
</RegularDetections>
</MonitorImplementation>
</UnitMonitorType>