Problem:
Email alerts by default have a very generic output. We have built in the ability to customize the alerts messages that are sent out to the end user.
Resolution:
The iDashboards Support team has created a template that you can use to improve the standard Alerts email template. Below are the instructions.
Installing Templates:
- Under the ivizgroup directory, create a new directory called 'templates'.
- Within 'templates' add an 'idbalerts' directory.
- Within the 'idbalerts' directory, add a new directory named 'alerts'. You should now have a path that looks something like ..\ivizgroup\templates\idbalerts\alerts
- Copy the attached template to the 'alerts' folder. The file name needs to be 'template.html'.
The attached 'template.html' file created as a general template. Feel free to modify the template as needed.
Macros that can be used in Email Alerts:
${ALERT_ID} | Alert ID. |
${ALERT_NAME} | Alert name. |
${ALERT_MESSAGE} | Alert message. |
${ALERT_DESCR} | Alert description. |
${SCHEDULED_CHECK_TIME} | The time at which the alert was scheduled to be checked. |
${ACTUAL_CHECK_TIME} | The time at which the alert was actually checked. |
${ALERT_VISIBILITY} | The alert’s visibility (“Public” for non-private alerts, or ”Private” for private alerts.) |
${MATCHINGROWSTABLE} | The matching rows are included in the email in the form of an HTML table. |
${MATCHINGROWSTEXT} | The matching rows are included in the email in plain text format. |
${SEVERITY} | The alert’s severity level (the numeric value.) |
${SEVERITY_NAME} | The name given to the alert’s severity level. |
${SEVERITY_RGB} | The severity color, in HEX RGB format, suitable for use in HTML emails. An example would be “FF0000”. |
${SEVERITY_RGB_INVERT} | The bit-wise inverse of the alert's severity color, in HEX RGB |
${CHART_ID} | Chart ID. |
${CHART_TITLE} | Chart title. |
${CHART_NAME} | Chart name (what is displayed for the chart in the Chart Open dialog.) |
${CHART_CATEGORY} | Name of the chart's ategory. |
Here is an example of the output:
Applies to: If you would like to know more about alerts please reference the Alerts Manual of the iDashboards version you are currently running.
More macros that can be used are listed below.
Alert ID: | ${ALERT_ID} |
Alert Name: | ${ALERT_NAME} |
Severity: | ${SEVERITY_NAME} |
Alert Message: | ${ALERT_MESSAGE} |
Alert Description: | ${ALERT_DESCR} |
Actual Check Time: | ${ACTUAL_CHECK_TIME} |
About this email:
This email was generated by the iDashboards Alerts Server running on ${SERVER_NAME}. It is built from a template file called "template.html", located in the directory ${TEMPLATE_DIRECTORY} on ${SERVER_NAME}. The template file is completely customizable. HTML-based emails can contain embedded images, which are either loaded from a remote server via URL (as the background image for this email was), or sent with the email itself as an attachment (as the iDashboards logo in this email was.) A plain-text template (template.txt) can also be used to create a plain-text attachment, which will be displayed in email clients that do not support HTML. Changes made to template.html or template.txt take effect immediately, without requiring a server restart.
When the email was created, the iDashboards Alerts Server scanned the template file for macros, which are special symbols, and replaced them with their appropriate expanded value.
Not every macro has an expanded value for every type of email. For instance, the ${DOLLAR}{ALERT_NAME} macro would not be available in an email notifying an administrator that the server is shutting down, since no specific alert would be associated with that event. When a macro has no actual expanded value, it is replaced with a zero-length string.
The following tables list the macros that can be used in email templates, along with descriptions and their current value (if any) within this email.
Alert Information
The macros in the following table can be used to include information about an alert in its notification emails. This information is also available in server error notification emails, when an error is related to a particular alert.Macro | Description | Current Value |
---|---|---|
${DOLLAR}{ALERT_ID} | Alert ID | ${ALERT_ID} |
${DOLLAR}{ALERT_NAME} | Alert Name | ${ALERT_NAME} |
${DOLLAR}{ALERT_MESSAGE} | Alert Message | ${ALERT_MESSAGE} |
${DOLLAR}{ALERT_DESCR} | Alert Description | ${ALERT_DESCR} |
${DOLLAR}{SCHEDULED_CHECK_TIME} | Scheduled Check Time | ${SCHEDULED_CHECK_TIME} |
${DOLLAR}{ACTUAL_CHECK_TIME} | Actual Check Time | ${ACTUAL_CHECK_TIME} |
${DOLLAR}{ALERT_VISIBILITY} | Alert Visibilty (Public or Private) | ${ALERT_VISIBILITY} |
${DOLLAR}{SEVERITY} | Severity Level (Numeric Value) | ${SEVERITY} |
${DOLLAR}{SEVERITY_NAME} | Severity Name | ${SEVERITY_NAME} |
${DOLLAR}{SEVERITY_RGB} | Severity Color, in HEX RGB format, suitable for use in HTML emails. | ${SEVERITY_RGB} |
${DOLLAR}{SEVERITY_RGB_INVERT} | The inverse of the Severity Color, in HEX RGB format, suitable for use as a foreground or background color in contrast with the Severity Color. | ${SEVERITY_RGB_INVERT} |
Chart Information
The macros in the following table can be used to include information about an alert's associated chart in its notification emails. This information is also available in server error notification emails, when an error is related to a particular alert.Macro | Description | Current Value |
---|---|---|
${DOLLAR}{CHART_ID} | Chart ID | ${CHART_ID} |
${DOLLAR}{CHART_TITLE} | Chart Title | ${CHART_TITLE} |
${DOLLAR}{CHART_NAME} | Chart Name (displayed in the Chart Open dialog.) | ${CHART_NAME} |
${DOLLAR}{CHART_CATEGORY} | Name of the chart's category. | ${CHART_CATEGORY} |
Server Event Information
The macros in the following table can be used in any email sent by the iDashboards Alerts Server to notify administrators of a server event, either a normal event (such as the server starting) or an error event.Macro | Description | Current Value |
---|---|---|
${DOLLAR}{EVENT_ID} | This is the ID used to identify this type of event. This value appears in the Event ID column on the Server Status screen. | ${EVENT_ID} |
${DOLLAR}{EVENT_SUBJECT} | A short phrase describing the type of event. This appears in the Subject column of the Server Status screen. | ${EVENT_SUBJECT} |
${DOLLAR}{EVENT_MESSAGE} | A message specific to this individual event. This appears in the Message column of the Server Events screen. | ${EVENT_MESSAGE} |
${DOLLAR}{EVENT_LEVEL} | The "Level" of the event, either INFO, WARNING or ERROR. | ${EVENT_LEVEL} |
${DOLLAR}{EVENT_QUEUE_ID} | This is a string consisting of the Event ID, possibly followed by additional characters that more specifically identify the type of event. This string is used internally by iDashboards and is generally not useful to administrators or end users. | ${EVENT_QUEUE_ID} |
${DOLLAR}{EVENT_MAX_EMAILS} | This is the maximum number of emails that will be sent for events with a particular Event Queue ID. A value of 0 or below indicates there is no limit, and an email will be sent for each occurrence of the event with the given Event Queue ID. This is used to prevent an administrator from receiving numerous identical emails related to a server error that occurs over and over again. | ${EVENT_MAX_EMAILS} |
${DOLLAR}{EVENT_TIMESTAMP} | This is the date and time when the event occurred. | ${EVENT_TIMESTAMP} |
Server Error Information
The macros in the following table can be used in any email sent by the iDashboards Alerts Server to notify administrators of a server error.Macro | Description | Current Value |
---|---|---|
${DOLLAR}{ERROR_MESSAGE} | This is the error message constructed by the iDashboards Alerts server. | ${ERROR_MESSAGE} |
${DOLLAR}{EXCEPTION_NAME} | If the error was the result of a Java "exception", this is the name of the exception class. This information is useful to iDashboards support personnel when troubleshooting a server error. | ${EXCEPTION_NAME} |
${DOLLAR}{EXCEPTION_MESSAGE} | This is the error message provided by the Java exception, if one exists. | ${EXCEPTION_MESSAGE} |
${DOLLAR}{EXCEPTION_STACKTRACE} | This is the "stacktrace" of the Java exception, which shows the exact point in the server code where the error occurred. This information is useful to iDashboards support personnel when troubleshooting a server error. | |
${EXCEPTION_STACKTRACE} |
Miscellaneous Information
The macros in the following table can be used in any email sent by the iDashboards Alerts Server.Macro | Description | Current Value |
---|---|---|
${DOLLAR}{SERVER_NAME} | The hostname of the machine on which the iDashboards Alerts Server is running. | ${SERVER_NAME} |
${DOLLAR}{TEMPLATE_DIRECTORY} | The directory, on ${SERVER_NAME}, where the template file (template.html) used to construct this email is located. | ${TEMPLATE_DIRECTORY} |
${DOLLAR}{DOLLAR} | This macro always expands to a dollar sign. It can be used when an email needs to contain the literal string "${DOLLAR}{." | ${DOLLAR} |
- X Platform
- Enterprise Suite
Comments
0 comments
Please sign in to leave a comment.