Windows 上的 MSSQL: 数据库配置

Microsoft.SQLServer.Windows.MonitorType.Database.DBConfigurationStatus (UnitMonitorType)

此监视器类型将检查 Windows 上的 MSSQL 数据库引擎安装上的数据库配置。

Element properties:

RunAsMicrosoft.SQLServer.Core.RunAs.Monitoring
AccessibilityInternal
Support Monitor RecalculateFalse

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.SQLServer.Windows.DataSource.DBConfiguration Default
FilterBad ConditionDetection System.ExpressionFilter Default
FilterGood ConditionDetection System.ExpressionFilter Default

Overrideable Parameters:

IDParameterTypeSelectorDisplay NameDescription
ExpectedValuestring$Config/ExpectedValue$预期值数据库配置设置的预期值。要查看适用值集,请参阅此监视器的知识库文章的“配置”部分。
SqlExecTimeoutSecondsint$Config/SqlExecTimeoutSeconds$
SqlTimeoutSecondsint$Config/SqlTimeoutSeconds$数据库连接超时(秒)如果在指定期间无法访问数据库,工作流将失败并注册一个事件。
TimeoutSecondsint$Config/TimeoutSeconds$超时(秒)指定工作流在关闭之前允许运行的时间,并标记为失败。
IntervalSecondsint$Config/IntervalSeconds$间隔(秒)运行工作流的重复间隔时间(秒)。
SyncTimestring$Config/SyncTime$同步时间使用 24 小时格式指定的同步时间。可以忽略。

Source Code:

<UnitMonitorType ID="Microsoft.SQLServer.Windows.MonitorType.Database.DBConfigurationStatus" Accessibility="Internal" RunAs="SqlCoreLib!Microsoft.SQLServer.Core.RunAs.Monitoring">
<MonitorTypeStates>
<MonitorTypeState ID="ConfigurationValueOK"/>
<MonitorTypeState ID="ConfigurationValueNotOK"/>
</MonitorTypeStates>
<Configuration>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="MachineName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="NetbiosComputerName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="InstanceName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="DatabaseName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ConfigName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ExpectedValue" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ConnectionString" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="InstanceVersion" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="InstanceEdition" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="MonitoringType" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="SqlExecTimeoutSeconds" type="xsd:int"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="SqlTimeoutSeconds" type="xsd:int"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="TimeoutSeconds" type="xsd:int"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="IntervalSeconds" type="xsd:int"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="SyncTime" type="xsd:string"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="ExpectedValue" ParameterType="string" Selector="$Config/ExpectedValue$"/>
<OverrideableParameter ID="SqlExecTimeoutSeconds" ParameterType="int" Selector="$Config/SqlExecTimeoutSeconds$"/>
<OverrideableParameter ID="SqlTimeoutSeconds" ParameterType="int" Selector="$Config/SqlTimeoutSeconds$"/>
<OverrideableParameter ID="TimeoutSeconds" ParameterType="int" Selector="$Config/TimeoutSeconds$"/>
<OverrideableParameter ID="IntervalSeconds" ParameterType="int" Selector="$Config/IntervalSeconds$"/>
<OverrideableParameter ID="SyncTime" ParameterType="string" Selector="$Config/SyncTime$"/>
</OverrideableParameters>
<MonitorImplementation>
<MemberModules>
<DataSource TypeID="Microsoft.SQLServer.Windows.DataSource.DBConfiguration" ID="DS">
<MachineName>$Config/MachineName$</MachineName>
<NetbiosComputerName>$Config/NetbiosComputerName$</NetbiosComputerName>
<InstanceName>$Config/InstanceName$</InstanceName>
<ConnectionString>$Config/ConnectionString$</ConnectionString>
<InstanceVersion>$Config/InstanceVersion$</InstanceVersion>
<InstanceEdition>$Config/InstanceEdition$</InstanceEdition>
<MonitoringType>$Config/MonitoringType$</MonitoringType>
<SqlExecTimeoutSeconds>$Config/SqlExecTimeoutSeconds$</SqlExecTimeoutSeconds>
<SqlTimeoutSeconds>$Config/SqlTimeoutSeconds$</SqlTimeoutSeconds>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
<IntervalSeconds>$Config/IntervalSeconds$</IntervalSeconds>
<SyncTime>$Config/SyncTime$</SyncTime>
</DataSource>
<ConditionDetection ID="FilterGood" TypeID="System!System.ExpressionFilter">
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>Property[@Name='DatabaseName']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">$Config/DatabaseName$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>Property[@Name='$Config/ConfigName$']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">$Config/ExpectedValue$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>Property[@Name='$Config/ConfigName$']</XPathQuery>
</ValueExpression>
<Operator>NotEqual</Operator>
<ValueExpression>
<Value Type="String">N/A</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</ConditionDetection>
<ConditionDetection ID="FilterBad" TypeID="System!System.ExpressionFilter">
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>Property[@Name='DatabaseName']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">$Config/DatabaseName$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>Property[@Name='$Config/ConfigName$']</XPathQuery>
</ValueExpression>
<Operator>NotEqual</Operator>
<ValueExpression>
<Value Type="String">$Config/ExpectedValue$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>Property[@Name='$Config/ConfigName$']</XPathQuery>
</ValueExpression>
<Operator>NotEqual</Operator>
<ValueExpression>
<Value Type="String">N/A</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</ConditionDetection>
</MemberModules>
<RegularDetections>
<RegularDetection MonitorTypeStateID="ConfigurationValueOK">
<Node ID="FilterGood">
<Node ID="DS"/>
</Node>
</RegularDetection>
<RegularDetection MonitorTypeStateID="ConfigurationValueNotOK">
<Node ID="FilterBad">
<Node ID="DS"/>
</Node>
</RegularDetection>
</RegularDetections>
</MonitorImplementation>
</UnitMonitorType>