Applies to
Summary
DBAs need to frequently monitor multiple SQL Server instances to verify the efficiency and error-free functioning of their respected environment. One’s first idea is to fully automate the majority of processes to ensure better time management and faster response time in case of emergency.
Although it is a very tempting idea to fully automate one’s responsibilities, in the majority of cases it is not recommended nor in anyone’s best interest to leave a production environment unattended. The next best thing is semi-automation in a sense where the DBA or the designated person in charge is notified via email whenever there are changes or issues with a SQL Server instance.
This is where ApexSQL Manage comes in place. The tool can send and manage email notifications that can be configured with specific schedules to notify the user when a certain task has been completed, failed or specific differences/issues have been detected.
Email notifications can be configured for the following situations:
- Discovery of new SQL Server instances
- SQL Server instance Health checks
- Comparison differences between SQL Server instances or SQL Server instance Snapshots
- SQL Server instance Documentation
- SQL Server instance snapshot creation
Description
This article serves to address key points on how to create and manage email notifications in ApexSQL Manage.
Since email notifications are tied to schedules, one must be created. Detailed instructions on this topic can be found in Automate and schedule operations in SQL manage instance software article.
Email configuration setup
Before configuring email notifications to notify users based on specific schedule results, an email address, which will be used to send emails, is required as well as specific set-up parameters.
To manage email notifications it is required to set up an email address first. Go to the Configuration tab in the main ribbon and click the Email button. This will open the Email configuration window where the following parameters are required to be added:
-
SMTP server which has predefined servers
- smtp.gmail.com
- smtp-mail.outlook.com
- smtp.office365.com
- smtp.mail.yahoo.com
- plus.smtp.mail.yahoo.com
- smtp.mail.com
- Port number – which is automatically changed for predefined SMTP servers
- Email address
- Password
- Subject
To test the email configuration parameters, click on the Test configuration button. This will send a test email confirming that the configuration is successful:
Once the email configuration has been tested, a confirmation email with the following content should be received:
|
Quick tip: Using a Google email address will require additional configuration on the Gmail side to allow ApexSQL Manage to use the email address. |
Email configuration for SQL Server Discovery schedules
Now when the requirements have been met and the email address which will be used to send notifications has been configured it is time to proceed to the main topic.
To configure and manage email notifications, go to the Schedules tab in the main ribbon and click on the Create button. This will open a drop-down menu from which a specific schedule can be created:
For this article, the Server discovery schedule will be created in the Notification card, and the following settings will be configured:
Discovery of notifying events:
- Success
- New server(s) found – email will include a list of new SQL Servers
Send email notifications to:
- Email address – to add an email address click on the Add button
Failure option can be checked to receive an email notification if the schedule doesn’t execute in the predefined time.
Checking the Skipped option will send an email notification if the schedule attempted to run during a maintenance period.
In the Summary tab, an overview and configuration of the schedule can be seen. For this specific schedule, ApexSQL Manage will search for SQL Server instances that haven’t been registered in the application using WMI, SCM, and SSRP scan methods. The schedule will run once a month on day 1 of that month at 12:00:00 AM and a notification will be sent to john.smith@quest.com with the list of newly discovered SQL Server instances:
Before running the schedule, there were only a few SQL Server instances registered in ApexSQL Manage. To view registered SQL Server instances and their details in ApexSQL Manage go the Inventory tab.
For this article, SQL Server instances currently registered in the tool are:
- DESKTOP-M714KTD
- DESKTOP-M714KTD\EXPRESS2012SERV4
- DESKTOP-M714KTD\MSSQLSERVER08R2E
- DESKTOP-M714KTD\MSSQLSERVER08R2S
- DESKTOP-M714KTD\MSSQLSERVER2016
When the schedule for newly discovered SQL Servers is executed, an email address with the following details will be received showing newly discovered SQL Servers instances:
Email configuration for SQL Server Health Check schedules
To configure and manage email notifications for health check schedules, go to the Schedules tab in the main ribbon, and click on the Create button. From the drop-down menu click on Health check:
For this article, the following setting will be configured in the Notification card:
Health check of notifying events:
- Success
- Attach report on finish – attaching a report will include a list of executed health checks and their results
- Number of failed rules greater than 1 – this option can be customized for unique environments to avoid false positives
Send email notifications to:
-
john.smith@quest.com
When the Health check schedule is executed, an email address with the following details will be received:
Email configuration for SQL Server Comparison schedules
To configure and manage email notifications for Comparison schedules, first, create a Comparison schedule and go to the Notification card. The process for configuring the majority of email notifications is identical with minor differences between the types of schedules. This schedule will be configured with the following settings:
Comparison of notifying events:
- Success
- Attach report on finish – attaching a report will include a list of executed health checks and their results
- Number of differences greater than 1 – this value can be configured based on the user environment and SQL Servers used for comparison
Send email notifications to:
-
john.smith@quest.com
SQL Server instances used in this comparison are SQL Server 2017 and SQL Server 2016 hence there is a large number of differences. When the Comparison schedule is executed, an email address with the following details will be received:
|
Quick tip: Comparison results can vary depending on the type of SQL Server instances compared, their version, database differences, logins, SQL Server instance settings, and SQL Server Jobs. |
Email configuration for SQL Server Documentation schedules
To configure and manageemail notifications for SQL Server documentation schedules, first, create a Documentation schedule and go to the Notification card. This schedule will be configured with the following settings:
Documentation of notifying events:
- Success
- Attach report on finish – attaching a report will include a list of executed health checks and their results
Send email notifications to:
-
john.smith@quest.com
Executing the Documentation schedule will result in the following email with a PDF attachment:
Email configuration for SQL Server Snapshot schedules
To configure and manage email notifications for SQL Server Snapshot schedules, first, create a Snapshot schedule and go to the Notification card. This schedule will be configured with the following settings:
Snapshot of notifying events:
- Success
Send email notifications to:
-
john.smith@quest.com
Executing the Snapshot schedule will result in the following email and a created Snapshot of the selected SQL Server instance:
Conclusion
To summarize, in this article examples have been shown on how to configure email notifications for the following schedules:
- Discovery of new SQL Server instances
- SQL Server instance Health checks
- Comparison differences between SQL Server instances
- SQL Server instance Documentation
- SQL Server instance snapshot creation
Depending on the situation and in the spirit of semi-automation, receiving email notifications for specific situations can be a very useful tool in a DBAs toolbelt.
Detailed information on schedule creation in ApexSQL Manage and core tool features related to this topic are:
- How to discover SQL Server instances, SSRS, SSAS and SSIS services across the network
- How to perform health checks on SQL Server instances with ApexSQL Manage
- How to make a comparison between SQL Server instances and snapshots
- How to create detailed documentation for SQL Server instances and snapshots
- Create SQL Server snapshots in ApexSQL Manage
- Automate and schedule operations in SQL manage instance software
- Maintenance period configuration in ApexSQL Manage