Create or edit a custom email template for DPA alert notifications
Use custom email templates to customize the contents of the email notifications that DPA sends when alerts are triggered. You can create multiple custom email templates for different types of alerts.
Templates allow you to include additional information in email alerts. DPA provides a set of default variables (such as the alert value and database name), and you can also include custom properties as variables. Receivers of email alert notifications can set up rules to prioritize, forward, or otherwise process incoming notifications based on this information.
- From the DPA menu in the upper-right corner, click Alerts.
- In the upper-right corner, click Manage alerts.
- Click the Email Templates tab.
-
Do one of the following:
-
To create a new email template, click Create email template.
The Create email template page opens. It includes the system-defined template definition as a starting point.
-
To edit an existing email template, click the email template name.
The Edit email template page displays the existing template definition.
-
- Enter a unique name and, optionally, a description.
- Specify the content and formatting of email notifications based on this template:
To add content:
Drag and drop variables from the right panel into the Subject line or body (or type the variables). These variables represent information about the triggered alert or links to additional information in DPA. For information about the available variables, see Email template variables.
Type static text into the Subject line or body.
To remove content, delete variables or static text from the Subject line or body.
To format body text with bold, italics, or line breaks:
Under Body message format, select HTML.
If Plain text is selected, any HTML tags are treated as text and shown in the alert notification email.
Enter the following tags to format the body text:
<b> </b>
<i> </i>
<br>
or<br />
All other tags are unsupported. You cannot save a template that contains unsupported tags.
- Click Save to save your changes and close the page.
-
Apply the email template to alerts in either of the following ways:
- To apply the template to a specific alert, edit the alert definition and select the template from the Email Template drop-down menu.
- To apply the template to all alerts that use the default email template, specify this template as the default.
Email template variables
The following variables are available:
Alert variables
Use these variables to include information about the alert that was triggered.
Name | Variable | Description |
---|---|---|
Alert name | [=alert.alertName] | The user-defined name that identifies the alert that was triggered. |
Type | [=alert.type] | The type of alert. |
Description | [=alert.description] | DPA's description of the alert type. |
Value | [=alert.value] | The value that triggered the alert. |
Execution time | [=alert.executionTime] | The date and time when the alert was triggered. |
Multiple results | [=alert.multiReturn] | A value of true or false to indicate whether the alert returns multiple values. |
Results |
[#list alert.results as result]
|
For Custom alerts that return multiple values, the parameter name, value, units (if specified in the alert parameters), and description (if specified in the alert parameters) for each returned value. For custom alerts executed against a stored procedure, you can add the alert.results tag to include the |
Thresholds | [#list alert.threshold as t]
Threshold level: [=t.level] * min: [#if t.levelMin??][=t.levelMin][#else]N/A[/#if] * max: [#if t.levelMax??][=t.levelMax][#else]N/A[/#if] [/#list] |
The minimum and maximum values for threshold levels that are specified in the alert definition. This variable does not return threshold information for Resources alerts because the thresholds are defined on the resource instead of in the alert definition. |
Alert Notification text | [=alert.notificationText] | The text from the Notification Text field in the alert definition. |
Alert Parameters | [#list alert.alertParameters as parameter, value]
[=parameter]: [=value] [/#list] |
For Wait Time and Administrative alerts, the name and value of the each parameter specified for the alert. If the alert type does not require parameters, this is blank. |
Resources parameters | [#list alert.resourceParameters as parameter, value] [=parameter]: [=value] [/#list] |
For Resources alerts, the name and value of each parameter specified for the alert. |
Alert Group ID | [=alert.group.id] | The ID of the alert group that the alert belongs to. |
Alert Group Name | [=alert.group.name] | The name of the alert group that the alert belongs to. |
Alert Group Description | [=alert.group.description] | The user-defined description of the alert group that the alert belongs to. |
Alert Status Value | [=alert.status.value] | The status of the alert (for example, High or Broken). |
Alert Error Message | [=alert.status.message] | When the alert is Broken, the error message generated when the alert is triggered. |
Single Alert | [=alert.singleAlert] | A value of true or false to indicate whether multiple result values are sent in a single message. True indicates that multiple results are sent in one message, and false indicates that they are sent separately. |
Database variables
Use these variables to include information about the monitored database instance on which the alert was triggered.
Name | Variable | Description |
---|---|---|
Name | [=database.name] | The DPA display name of the monitored database instance. |
Type | [=database.databaseType] | The type of monitored database instance. |
IP address | [=database.ipAddress] | The IP address of the database server. |
Hostname | [=database.hostname] | The host name of the database server. |
Port | [=database.port] | The port used by the monitored database instance. |
Version | [=database.databaseVersion] | Version of the monitored database instance. |
Full type | [=database.databaseFullType] | The full type of the monitored database instance. |
Link variables
Use these variables to include links to related information in DPA.
Name | Variable | Description |
---|---|---|
Alert Status | [=links.alertStatus] | A link to the Alert Status tab, from which you can view the status and history of the alert. |
Alert Trends | [=links.alertTrends] | A link to the 1-day Trends chart for the day on which the alert was triggered. |
Alert History | [=links.alertHistory] | A link to the detailed history of the alert on the database instance where it was triggered. |
Instance Alerts | [=links.instanceAlerts] | A link to the Alert Status tab filtered to show only the alerts configured to run on the database instance where the alert was triggered. |
Notification | [#list links.notification as label, url] [=label]: [=url] [/#list] |
A link to the DPA chart associated with the alert type. For example, the link for a Database Instance Wait Time Anomaly alert opens the Anomaly Detection chart for the day when the alert was triggered. If no chart is associated with the alert type, this is blank. |
DPA alert variables
These variables define the default DPA alert content.
Name | Variable | Description |
---|---|---|
Subject | [=dpa.subject] |
The default subject line of an email alert. This variable includes the alert name, the database instance, and the alert level in the following format:
For example:
|
Results | [=dpa.body] |
The default body text of an email alert. This variable includes the alert status link, the alert notification text, and the value that triggered the alert. Each element is a separate paragraph. For example:
|
Custom properties
In addition to the predefined variables listed above, you can create custom properties to include other information in alert notification email templates. If any custom properties have been created for this DPA server, they are displayed in the Custom properties section in the Variables list.
The following example includes the custom properties DBA Assigned and Location. All DBAs receive these email notifications, but the DBAs can set up rules to process them. For example, a DBA named Bill Smith has a rule to delete DPA alert notifications if the Subject does not contain DBA Assigned: Bill Smith
. If the Subject does contain that string, he has another rule to flag the email as important.