Database consistency error from event 5180

AK62623.DatabaseConsistencyError5180 (Rule)

In this rule we generate the alert from the event 5180

Knowledge Base article:

External

http://go.microsoft.com/fwlink/?LinkId=199727

Element properties:

TargetMicrosoft.KnowledgeServices.SQLServer.Database
CategoryAlert
EnabledTrue
Alert GenerateTrue
Alert SeverityError
Alert PriorityHigh
RemotableTrue
Alert Message
SQL Server has encountered a database consistency error: Msg 5180

<Details>
<Content>Msg 5180 was logged in the Windows Application Event Log. This error can indicate a database consistency problem. SQL Server generates a 5180 error when it detects that a FileID being referenced within SQL Server metadata (typically on a database page) is not valid for the database. Consider running a full database consistency check (DBCC CHECKDB) to determine the extent of all consistency errors. See the Information collected below for the database context for which this error was detected.</Content>
<CollectedInformation>
<Info>
<Name>Database reported for this error</Name>
<Value>{0}</Value>
</Info>
</CollectedInformation>
</Details>
Event LogApplication

Member Modules:

ID Module Type TypeId RunAs 
IORequestDelayEventProvider DataSource Microsoft.Windows.EventProvider Default
GenerateAlert WriteAction System.Health.GenerateAlert Default

Source Code:

<Rule ID="AK62623.DatabaseConsistencyError5180" Enabled="true" Target="KnowledgeServicesSQLServerLibrary!Microsoft.KnowledgeServices.SQLServer.Database" ConfirmDelivery="true" Remotable="true" Priority="Normal" DiscardLevel="100">
<Category>Alert</Category>
<DataSources>
<DataSource ID="IORequestDelayEventProvider" TypeID="Windows!Microsoft.Windows.EventProvider">
<ComputerName>$Target/Host/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
<LogName>Application</LogName>
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">PublisherName</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">$Target/Host/Property[Type="MicrosoftSQLServerLibrary!Microsoft.SQLServer.DBEngine"]/ServiceName$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="UnsignedInteger">EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="UnsignedInteger">5180</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">EventData/DataItem/*[local-name()='EventData']/*[local-name()='Data'][2]</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">$Target/Property[Type="MicrosoftSQLServerLibrary!Microsoft.SQLServer.Database"]/DatabaseName$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="GenerateAlert" TypeID="Health!System.Health.GenerateAlert">
<Priority>2</Priority>
<Severity>2</Severity>
<AlertMessageId>$MPElement[Name="AK62623.DatabaseConsistencyError5180.AlertDisplayString"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="MicrosoftSQLServerLibrary!Microsoft.SQLServer.Database"]/DatabaseName$</AlertParameter1>
</AlertParameters>
<Suppression>
<SuppressionValue>$Target/Property[Type="MicrosoftSQLServerLibrary!Microsoft.SQLServer.Database"]/DatabaseName$</SuppressionValue>
<SuppressionValue>$Target/Host/Property[Type="MicrosoftSQLServerLibrary!Microsoft.SQLServer.ServerRole"]/InstanceName$</SuppressionValue>
</Suppression>
<Custom1>Administration\Disaster Recovery, Backup/Restore, Attach/Detach, DB corruption</Custom1>
<Custom2/>
<Custom3/>
<Custom4/>
<Custom5/>
<Custom6/>
<Custom7/>
<Custom8/>
<Custom9/>
<Custom10>1.0.0.21</Custom10>
</WriteAction>
</WriteActions>
</Rule>