HiveBrain v1.2.0
Get Started
← Back to all entries
debugsqlMinor

Adding warning with sp_add_alert doesn't work with "Greater Than" and SQL Server 2014

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
serverwithgreaterthanandsqladdingdoesnworkwarning

Problem

We upgraded our SQL Server from 2008 R2 to 2014.

I want to add a custom warning.

USE [msdb]
GO

EXEC msdb.dbo.sp_add_alert @name = N'MAN more than 1000', 
                           @enabled = 1, 
                           @delay_between_responses = 0, 
                           @include_event_description_in = 1, 
                           @performance_condition = N'Replication Dist.|Dist:Delivered     Cmds/sec|MyFancyReplication|>|1000', 
                           @job_id = N'00000000-0000-0000-0000-000000000000'
GO


This has worked with SQL Server 2008 R2.

When I want to add this Warning, but all I get is this error (it's translated, because my original is German)


A performance condition must be formatted as:

‘object_name|counter_name|instance_name|comparator( or ` in the error message?

Why can't I add my custom warning?

Best Regards

Björn

Solution

after research, I had found the answer. The Problem is the @performance_condition, my example will not work. But if I add a "SQLServer:" at the beginning of the Condition, like this:

N'SQLServer:Replication Dist.|Dist:Delivered Cmds/sec|MyFancyReplication|>|1000'


This is the Key to add custom warnings to Sql Server 2014. I believe this is a bug with the new SqlServer2k14.

Regards
Björn

Code Snippets

N'SQLServer:Replication Dist.|Dist:Delivered Cmds/sec|MyFancyReplication|>|1000'

Context

StackExchange Database Administrators Q#71261, answer score: 2

Revisions (0)

No revisions yet.