Comments
3 comments
-
Be sure to add your SQL Monitor Service Account to the MSDB Database and add it to the DatabaseMailUserRole.
-
Thanks for the reply Chris, the SQL Monitor Service Account is a sysadmin on the target server
-
Hi @achilleas_delenda
I completely forgot that everything done in the Custom Metric T-SQL section is done in a transaction that is rolled back which stops the email from being sent.
This is for security reasons and the initial intention of the custom metric was just to gather data not to modify anything.
I would suggest looking to see if there is a suggestion on https://sqlmonitor.uservoice.com/forums/91743-suggestions for this and if not raising your own.
Kind regards,
Alex
Add comment
Please sign in to leave a comment.
We are big users of the custom metrics.
We were looking to find ways to enhance them by allowing the metric to send an email when a condition has been met.
When we run the query (exec msdb.dbo.sp_send_dbmail etc.) directly on the SQL instance , an email is sent successfully, however, when we run it via SQL Monitor, nothing happens.
Anyone got any ideas?
Thanks in advance,
Achilleas