Message templates are defined in the Alarm message templates page in the configuration view.
Each template consists from minimum of two template strings. One for email subject line and one for email body text.
Name of the template is used to identify the template for the configuration user and can be selected freely.
Default locale is used to define the language of the messages. Currently only english is supported for the user interface so it is recommended to select en.
For each Template string following items need to be defined.
Severity level allows to define a separate message for a specific severity level. If separate messages are not needed it is recommended to use DEFAULT here.
Action allows to define a separate message for the situation the value is entering or leaving alarming zone. If separate messages are not needed it is recommended to use DEFAULT here.
Locale is a required field. Use same setting as in the heading level e.g. en.
Element is used to select if the current template is either
- Subject
- Body (html)
- Body (text)
By selecting html-version of the body user can format the message with html-tags.
Depending on the element selected a field is opened.
Both subjects and bodies support variables which are listed below as well as in the i tooltip in the configuration view.
Template string content can include variables. Variables are specified using double curly brackets around the variable name, {{<variableName>}}
Example:
Template string content: {{groupName}} {{metricId}} has reached {{severityName}} level ({{threshold}}) on {{localizedOccurred}}
Output text: MyGroup MyMetric has reached critical level (85) on October 25th 2018, 09:32:13
Supported variables See supported variables in the table below:
Variable | Type | Description |
---|---|---|
action | String | Alarm action, either ‘enter’ when entering the alarm state or ‘leave’ when leaving alarm state |
alarmName | String | Name of the alarm |
created | Timestamp | Tells when the alarm event was received from the terminal. |
groupId | String | Id of the group that was the source of the alarm |
groupName | String | Name of the group that was the source of the alarm |
localizedCreated | DateString | Same as created but in a different format. |
localizedOccurred | DateString | Same as occurred but in a different format. |
metricId | String | Name of the metric, i.e. the ‘caption’ tag value |
occurred | Timestamp | Time when the alarm situation occurred in the first place. Can be much earlier than the value of the created variable if terminal has been offline when alarm condition was noticed. |
quality | String | Specifies the quality of the metric |
severity | Number | Severity level value |
severityName | String | Name of the alarm severity, e.g. ‘critical’. |
unit | String | Specifies the unit of the metric |
target | String | Measurement target value |
threshold | Number | Threshold value of the alarm configuration |
link | String | Specifies a link that points to the alarmed device in monitoring user interface. |
Data types:
- Array – an array containing values of some other data type.
- DateString – date and time in the following format: ‘MMMM Do YYYY, HH:mm:ss’.
For example, ‘October 25th 2018, 09:32:13’ in English or ‘lokakuu 25. 2018, 09:32:13’ in Finnish.
Used language depends on the language of the template.
Please note that all dates are now shown in UTC timezone. - Number – numerical data
- String – textual data
- Timestamp – the number of milliseconds since 00:00:00 UTC on January 1, 1970
Tags
Metric tag information is not directly available as variables but can be accessed using a tag helper
{{tag “<tagkey>”}}
where <tagkey> is key of the tag.
Example:
Assuming that the metric has a tag myTagKey:myTagValue
Template string content: Here is the value of my tag: {{tag “myTagKey”}}
Output text: Here is the value of my tag: myTagValue