SQL 2005 WMI 屬性檢查
Microsoft.SQLServer.2005.WMIAdvancedPropertyProvider (UnitMonitorType)
此監視器類型會檢查 SQL WMI 屬性是否符合指定的預期值。
Element properties:
Member Modules:
Overrideable Parameters:
Source Code:
<UnitMonitorType ID="Microsoft.SQLServer.2005.WMIAdvancedPropertyProvider" Accessibility="Internal" RunAs="SQL!Microsoft.SQLServer.SQLDefaultAccount">
<MonitorTypeStates>
<MonitorTypeState ID="ValueGood"/>
<MonitorTypeState ID="ValueBad"/>
</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="SQLServiceName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="PropertyName" 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="GoodValue" type="xsd:string"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="IntervalSeconds" ParameterType="int" Selector="$Config/IntervalSeconds$"/>
<OverrideableParameter ID="GoodValue" ParameterType="string" Selector="$Config/GoodValue$"/>
</OverrideableParameters>
<MonitorImplementation>
<MemberModules>
<DataSource TypeID="Windows!Microsoft.Windows.WmiProvider" ID="DataSource">
<NameSpace>\\$Config/ComputerName$\root\Microsoft\SQLServer\ComputerManagement</NameSpace>
<Query>SELECT * FROM SQLServiceAdvancedProperty WHERE ServiceName = '$Config/SQLServiceName$' AND PropertyName = '$Config/PropertyName$'</Query>
<Frequency>$Config/IntervalSeconds$</Frequency>
</DataSource>
<ConditionDetection TypeID="System!System.ExpressionFilter" ID="GoodFilter">
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>Property[@Name='PropertyNumValue']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>$Config/GoodValue$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</ConditionDetection>
<ConditionDetection TypeID="System!System.ExpressionFilter" ID="BadFilter">
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>Property[@Name='PropertyNumValue']</XPathQuery>
</ValueExpression>
<Operator>NotEqual</Operator>
<ValueExpression>
<Value>$Config/GoodValue$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</ConditionDetection>
</MemberModules>
<RegularDetections>
<RegularDetection MonitorTypeStateID="ValueGood">
<Node ID="GoodFilter">
<Node ID="DataSource"/>
</Node>
</RegularDetection>
<RegularDetection MonitorTypeStateID="ValueBad">
<Node ID="BadFilter">
<Node ID="DataSource"/>
</Node>
</RegularDetection>
</RegularDetections>
</MonitorImplementation>
</UnitMonitorType>