This article explains how to set up custom SMTP and email profiles to send SMS alert notifications using the ApexSQL Monitor alert action feature, including necessary requirements.
Notifications on triggered alerts from ApexSQL Monitor can be sent in the form of a short message directly to a desired cell phone number. This can be achieved utilizing the SMS gateway service, which sends emails (and other media, like IM messages) through a telecommunication network. Gateways for transmitting emails will be in the scope of this article..
To send SMS alert notifications from ApexSQL Monitor, the following requirements must be fulfilled:
a special email address for using the SMS gateway service: for example, a majority of US-based telecommunication companies provide this service, usually by user request.
The common format of this email address is: <number>@<gateway_provider_website> (firstname.lastname@example.org, e.g.)
See the SMS gateway providers global list and specific requirements for using this service here. Note that configuration and email address format used within SMS gateway service depends on its provider.
- An ApexSQL Monitor custom SMTP profile: this profile will be configured and used as the sender
- An ApexSQL Monitor custom email profile, which will include a gateway email address as the recipient.
Details and tips on creating required profiles will be explained in the following paragraph.
Configure profiles for sending SMS alerts
First, we will set the custom SMTP profile. To do that, navigate to the Administration subsystem, and choose SMTP settings option.
Input necessary data like shown below: full SMTP server address, valid port and server authentication credentials:
To validate the profile, click Test button, and add the recipient, to send ApexSQL Monitor test message:
If test attempt is successful, a confirmation message will appear:
After saving, the new profile will appear in the list, as shown below:
When the sender profile is set, the next step is creating the custom email profile, which will be used as an alert action in the final step.
Navigate to the Administration subsystem on main menu, or by clicking the breadcrumb (marked on the picture below):
Click on the Email profiles option:
For this occasion, create the email profile named DBA cell phone. Input data in corresponding fields:
The recipient here is an example of the SMS gateway-related email address. Optionally, you can include a standard email address of the person which will receive the SMS alert notification (for example), for logging purposes and to assure that notification will be observed.
After saving, the custom email profile will appear in the list:
Set alert action to receive SMS notifications
To put in function previously prepared email profile, embed it into the email alert action named Send SMS notifications.
Choose a desired SQL instance, go to the Configuration subsystem, Alert action tab, and add a new alert action:
Select the email alert action (Add email profile option):
To name this alert action profile, as mentioned before, choose DBA cell phone email profile and set the time interval (in minutes), in which summary email will be sent, or choose to receive an email (SMS, in this case) for each of the alert (based on checked severity), when it triggers.
For this purpose a default time interval for sending summary email(s) is 60 minutes.
If a large number of alerts is coming from the monitored instance, avoid Send a summary email option, because it will not fit into one or two short messages. Rather utilize one alert per message, by choosing the other option, and narrow the severity of alerts that have higher priority
Review the created alert action,
and then save and review the alert action profile:
Append the alert action to metric or set of metrics
To implement the Send SMS notifications alert profile for a specific metric or set of metrics, click the Metrics tab in the same subsystem. Make sure that Alerting option is checked for the metric (or metrics), for which the SMS notification profile will be set.
To illustrate this process, we will include this alert action profile to one of the SQL Server metrics, SQL Server availability (as shown below):
Since this metric has descriptive values only (Accessible and Not Accessible), it is sufficient to select to receive alerts with the high threshold in the email profile.
Example of the SMS notification
Since the text for a single email notification cannot be customized, the SMS notification will follow the same form.
Here is a real-world example:
Metric ‘SQL Server availability’
– Value: Not accessible
– Measured at: 03/30/2014 02:16:01 PM -08:00
As an illustration, this is how it should appear on the cell phone screen:
Q: Can I combine multiple alert actions into a single alert action profile?
Q: Can I include multiple SMS recipients in a single email profile?
A: Yes, as long as they are separated correctly in To: and/or CC: fields, with comma, semicolon or space, and if they follow the specified format for emails used by SMS gateway service (phone_number@service, e.g.)
Q: Can I use SMTP settings from free-of-charge email services within ApexSQL Monitor, like Gmail, Yahoo etc.?
A: Yes, but as for the other SMTP providers, it is recommended to check SSL authentication (provided in SMTP settings, while creating a profile), to secure the connection to a dedicated SMTP server.
Q: After successful test attempt while setting a custom SMTP profile, how the confirmation email/SMS looks like?
A: It looks like this:
In the picture above, a customized Gmail account is used, and ApexSQL Monitor automatically replaces the user name from provided credentials within SMTP profile with its own name string. In this article, we used an actual Gmail account as a SMTP provider, for illustrative purposes.
The same message text will appear in the SMS test notification, as well.
Q: My SMTP host reports ApexSQL Monitor as a less secure application even if I input valid credentials and checked SSL authentication? Should I worry about that, and what can I do?
A: ApexSQL Monitor is capable of using SMTP settings from a desired host, but in order to secure the connection and exclude the possibility of email security problems, SMTP hosts are using an extra layer of protection by identifying a less secure application. For example, Gmail SMTP host recognizes testing attempts from ApexSQL Monitor as “less secure”, but it is false positive, which is the reason why it is recommended to use SSL authentication within the custom SMTP profile.