• Hi David,

    Bad AND Good news!

    I was able to recreate your problem, event 32040 etc are indeed written to event log, and no email is generated. As you suggest, this is because my script sets the "Database Name" property on the Alert.

    Ive had a look on MS Connect and this seems to be a popular problem, for example:

    https://connect.microsoft.com/SQLServer/feedback/details/266658/mirroring-monitoring-issues

    The lack of a database name in the event means SQL Server cannot bind the alert.

    There is however, a workaround (and good news). You could delete all threshold alerts and create 1 for all databases (just set the database name property to <all databases>).

    That way, you would get an email alert, and with the alert firing (ive tested this, the event definitly does fire when using <all databases>) you can edit the event to run a SQL job (see sp_update_alert - the @job_id paramater),

    the job in question could run a simple SP that executes the following for each database and collates and emails the results:

    use msdb

    exec sys.sp_dbmmonitorresults @database_name=N'synergy', @mode = 0, @update_table = 1

    That way, when a threshold is exceeded, you will receive an email telling you which threshold has been exceeded, and a 2nd email detailing which database is causing the problem.

    I will revise my script with this behaviour at some point, but dont hold your breath, i am extremely busy at the moment.

    Hope that makes sense 🙂

    Regards

    Jordon

    Knock Knock, Who's There?, sp underscore, sp underscore who?
    spid1, spid2, spid3....