SQL Server Email Alerting

Overview

Database Health Monitors SQL Server Email Alerting is a powerful tool designed to keep you informed about your SQL Server environment’s health. By integrating email alerts into your SQL Server monitoring system, this tool allows you to proactively address issues that may arise. Whether it’s a performance degradation, a security concern, or other critical events, the SQL Server Email Alerting tool ensures that you receive timely notifications.

Features

  • Customizable Alerts: Set up email notifications based on various server health conditions such as query timeouts, deadlocks, and long-running queries.
  • Multiple Recipients: Configure multiple email addresses to receive alerts, ensuring that key stakeholders are always informed.
  • Configurable Triggers: Define specific triggers for alerts, allowing for fine-grained control over when and how you are notified.
  • Alert Duplication: Create duplicates of alerts to configure higher or lower parameters with different recipients.

Getting Started

  1. Configure SQL Database Mail:
    • SQL Database Mail allows SQL Server to send email alerts. Before using the SQL Server Email Alerting tool, you’ll need to configure Database Mail in your SQL Server instance.
    • For more information on how to set up Database Mail check out our video below.
  2. Open the Configuration Manager:
    • Open the email reporting configuration manager by right clicking on your instance in the tree view or by clicking on the Configure Alerts button in the Email Alert Log instance report.
    • After opening the configuration manager select the SQL Email Profile that you wish to use.
  3. Test Your Database Mail:
    • Using the Send Test Email button in the configuration manager you can send a test email to ensure your database mail profile is correctly configured.
  4. Configure Alerts:
    • Now you can set up alerts in the tool. You can configure multiple types of alerts based on your monitoring needs.
    • Alerts come with recommended configurations but these can be adjusted to suit the needs of your instance. More information on each specific setting can be found below.

Alert Settings

  • Alert Type: The Alert Type displays the name of the current alert being configured, when adding a duplicate alert this allows you to select the alert you would like to duplicate.
  • Alert ID: The Alert ID displays the ID of the current alert being configured. Alert ID’s cannot be changed after creation.
  • Time Between Checks: The Time Between Checks setting determines how often the TSQL for each check gets ran. In the example below, the Average CPU Usage check gets ran every 5 minutes.
  • Time Between Alerts: The Time Between Alerts setting determines how often an email gets sent when a threshold is reached. For the example below when the Average CPU Usage is triggered it will send an email every 10 minutes until cleared.
  • Threshold Greater Than: The Threshold Greater than setting is one of 2 points that tells an alert when to send an email. In the example below if the average CPU usage in the past hour is above 80% an email will be sent when the TSQL for that alert is ran.
  • Threshold Less Than: The Threshold Less than is the second of 2 points that tells an alert when to send an email. In the configuration below a less than threshold is not set, but could be set to 5 so that an email is sent when average CPU usage for the past hour drops below 5% or above 80%.
  • Email Addresses: Email Addresses for each alert must be added to the Alert Config before enabling an alert. Email addresses should follow the example below and should not contain leading or trailing characters.
  • Alert Looks Back: Some Alerts require a time frame to look back such as the File Growth over time or Login Attempts alerts. In the case of the Login Attempts alert, setting the time to look back parameter to 60 would give you the number of failed logins over the past hour

Troubleshooting

If you are not receiving email alerts:

  • Verify that the SMTP server settings are correct and that your SQL Server can send emails through it.
  • Check your email inbox for any blocked emails or filters that might prevent the alert emails from reaching you.
  • Ensure that the alert conditions are set correctly, and review the Email Alert Log Instance Report to see if any alerts were triggered.

Related

Getting Help from Steve and the Stedman Solutions Team

We are ready to help. The team at Stedman Solutions are here to assist with your SQL Server needs. Get help today by contacting Stedman Solutions through the free 30-minute consultation form.