SQL 2008 Service Pack Check

Microsoft.SQLServer.2008.ServicePackVersion (UnitMonitorType)

This monitor type checks the current service pack is greater than or equal the specified value.

Element properties:

RunAsDefault
AccessibilityInternal
Support Monitor RecalculateFalse

Member Modules:

ID Module Type TypeId RunAs 
DataSource DataSource Microsoft.Windows.WmiProvider Default
BadFilter ConditionDetection System.ExpressionFilter Default
GoodFilter ConditionDetection System.ExpressionFilter Default

Overrideable Parameters:

IDParameterTypeSelectorDisplay NameDescription
IntervalSecondsint$Config/IntervalSeconds$Frequency (seconds)
GoodValueint$Config/GoodValue$Good Value

Source Code:

<UnitMonitorType ID="Microsoft.SQLServer.2008.ServicePackVersion" Accessibility="Internal">
<MonitorTypeStates>
<MonitorTypeState ID="ValueGood"/>
<MonitorTypeState ID="ValueBad"/>
</MonitorTypeStates>
<Configuration>
<xsd:element name="ComputerName" type="xsd:string"/>
<xsd:element name="SQLServiceName" type="xsd:string"/>
<xsd:element name="IntervalSeconds" type="xsd:integer"/>
<xsd:element name="GoodValue" type="xsd:int"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="IntervalSeconds" ParameterType="int" Selector="$Config/IntervalSeconds$"/>
<OverrideableParameter ID="GoodValue" ParameterType="int" Selector="$Config/GoodValue$"/>
</OverrideableParameters>
<MonitorImplementation>
<MemberModules>
<DataSource TypeID="Windows!Microsoft.Windows.WmiProvider" ID="DataSource">
<NameSpace>\\$Config/ComputerName$\root\Microsoft\SQLServer\ComputerManagement10</NameSpace>
<Query>SELECT * FROM SQLServiceAdvancedProperty WHERE ServiceName = '$Config/SQLServiceName$' AND PropertyName = 'SPLEVEL'</Query>
<Frequency>$Config/IntervalSeconds$</Frequency>
</DataSource>
<ConditionDetection TypeID="System!System.ExpressionFilter" ID="GoodFilter">
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Integer">Property[@Name='PropertyNumValue']</XPathQuery>
</ValueExpression>
<Operator>GreaterEqual</Operator>
<ValueExpression>
<Value Type="Integer">$Config/GoodValue$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</ConditionDetection>
<ConditionDetection TypeID="System!System.ExpressionFilter" ID="BadFilter">
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Integer">Property[@Name='PropertyNumValue']</XPathQuery>
</ValueExpression>
<Operator>Less</Operator>
<ValueExpression>
<Value Type="Integer">$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>