MSSQL on Linux: DB Engine Service Restart Detection Provider

Microsoft.SQLServer.Linux.DataSource.DBEngineServiceRestart (DataSourceModuleType)

SQL DB Engine Service Restart Detection Provider on Linux

Element properties:

TypeDataSourceModuleType
IsolationAny
AccessibilityInternal
RunAsMicrosoft.SQLServer.Core.RunAs.Monitoring
OutputTypeSystem.PropertyBagData

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.SQLServer.Linux.DataSource.MSSQLLogReader2EventChange Default
FilterMsg ConditionDetection System.ExpressionFilter Default

Overrideable Parameters:

IDParameterTypeSelectorDisplay NameDescription
CorrelatorIntervalint$Config/CorrelatorInterval$Unavailable Time (seconds)The workflow will try to catch a service start event during this time frame, after event service stops.
TimeoutSecondsint$Config/TimeoutSeconds$Timeout (seconds)Specifies the time the workflow is allowed to run before being closed and marked as failed.
SqlExecTimeoutSecondsint$Config/SqlExecTimeoutSeconds$Timeout for query execution (seconds)The workflow will fail and register an event, if the query execution takes longer than the specified period.
SqlTimeoutSecondsint$Config/SqlTimeoutSeconds$Timeout for database connection (seconds)The workflow will fail and register an event, if it cannot access the database during the specified period.

Source Code:

<DataSourceModuleType ID="Microsoft.SQLServer.Linux.DataSource.DBEngineServiceRestart" Accessibility="Internal" RunAs="SqlCoreLib!Microsoft.SQLServer.Core.RunAs.Monitoring">
<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="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="TimeoutSeconds" type="xsd:int"/>
<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="CorrelatorInterval" type="xsd:integer"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="CorrelatorInterval" ParameterType="int" Selector="$Config/CorrelatorInterval$"/>
<OverrideableParameter ID="TimeoutSeconds" ParameterType="int" Selector="$Config/TimeoutSeconds$"/>
<OverrideableParameter ID="SqlExecTimeoutSeconds" ParameterType="int" Selector="$Config/SqlExecTimeoutSeconds$"/>
<OverrideableParameter ID="SqlTimeoutSeconds" ParameterType="int" Selector="$Config/SqlTimeoutSeconds$"/>
</OverrideableParameters>
<ModuleImplementation>
<Composite>
<MemberModules>
<DataSource ID="DS" TypeID="Microsoft.SQLServer.Linux.DataSource.MSSQLLogReader2EventChange">
<MachineName>$Config/MachineName$</MachineName>
<NetbiosComputerName>$Config/NetbiosComputerName$</NetbiosComputerName>
<InstanceName>$Config/InstanceName$</InstanceName>
<ConnectionString>$Config/ConnectionString$</ConnectionString>
<InstanceVersion>$Config/InstanceVersion$</InstanceVersion>
<InstanceEdition>$Config/InstanceEdition$</InstanceEdition>
<Login>$RunAs[Name="SqlCoreLib!Microsoft.SQLServer.Core.RunAs.SqlCredentials"]/UserName$</Login>
<Password>$RunAs[Name="SqlCoreLib!Microsoft.SQLServer.Core.RunAs.SqlCredentials"]/Password$</Password>
<SqlExecTimeoutSeconds>$Config/SqlExecTimeoutSeconds$</SqlExecTimeoutSeconds>
<SqlTimeoutSeconds>$Config/SqlTimeoutSeconds$</SqlTimeoutSeconds>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
<Publisher>SQLMonitoringLinux</Publisher>
<ManagementGroupName>$Target/ManagementGroup/Name$</ManagementGroupName>
<ReadFromStartOfLog>false</ReadFromStartOfLog>
<FilterMsg>(.*)</FilterMsg>
<Matches>
<Value>
<Key>ShutDown</Key>
<IsUniq>false</IsUniq>
<Match>(SQL Trace was stopped due to server shutdown\..*\.)</Match>
</Value>
<Value>
<Key>Startup</Key>
<IsUniq>false</IsUniq>
<Match>(SQL Server is starting at normal priority base \(=7\)\. This is an informational message only\. No user action is required\.)</Match>
</Value>
</Matches>
<UseRegExSearch>true</UseRegExSearch>
<UsePrevLineSearch>false</UsePrevLineSearch>
<NameOfHandler>DBEngine_Service_Restart_Detection</NameOfHandler>
<LogReaderInterval>10</LogReaderInterval>
<CorrelatorInterval>$Config/CorrelatorInterval$</CorrelatorInterval>
</DataSource>
<ConditionDetection ID="FilterMsg" TypeID="System!System.ExpressionFilter">
<Expression>
<And>
<Expression>
<Exists>
<ValueExpression>
<Value Type="String">Property[@Name='EventInterval']</Value>
</ValueExpression>
</Exists>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<Value Type="String">Property[@Name='EventInterval']</Value>
</ValueExpression>
<Operator>NotEqual</Operator>
<ValueExpression>
<Value Type="String"/>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</ConditionDetection>
</MemberModules>
<Composition>
<Node ID="FilterMsg">
<Node ID="DS"/>
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.PropertyBagData</OutputType>
</DataSourceModuleType>