The content and format of alert notifications are governed by Groovy server pages.

The pages are located in the \server-n.n.n-EE\hq-engine\hq-server\webapps\ROOT\WEB-INF\alertTemplates directory.

The following files are included.

Alert Template Files

File Name

Purpose

subject.gsp

Defines the subject line in email notifications.

html_email.gsp

Defines the body of an HTML email alert notification.

text_email.gsp

Defines the body of a text email alert notification.

sms_email.gsp

Defines the body of an SMS alert notification.

opennms_notify.gsp

Defines an OpenNMS SNMP trap.

snmp_trap.gsp

Defines an SNMP trap.

You can send email notifications to individually name recipients, all users with a specific role, or to recipients who are not vCenter Hyperic users. Email to a vCenter Hyperic user is sent in the mail format specified in the user's user profile.

The subject line of an email notification contains the string HQ followed by the alert priority, the alert definition name, the name of the resource for which the alert conditions were met, and the alert status. The format of the subject line is [HQ] ${priority} - ${alertDef.name} ${resource.name} ${status}. For example, [HQ]!! - High Disk Usage saint Win32 File System R:(remote/NTFS) notifies the recipients of a medium-high alert named " High Disk Usage" that was triggered for a resource named "saint Win32 File System R:\ (remote/NTFS)".

A variety of details are included in the body of an alert notification.

Resource name

Alert name

Date and time of the alert

Condition that triggered the alert. For example, the threshold value condition that triggers the alert and the specific value that triggered this alert.

Severity of the alert

In the case of an alert on an individual resource, the last value of the each of the resource's indicator metrics before the alert was triggered

In the case of an alert for a group of resources, a list of the group's member resources that triggered the alert, and a link to a chart that displays the metrics that triggered the alert

A link to the alert detail in the user interface

There are a number of variables that you can reference in the .gsp templates that govern the content of alert notifications. You use alert-related classes to define the variables.

You insert variables in the format $ClassVar.FieldVar, where ClassVar is the class with the field, and FieldVar is a field for which the class contains a get() method. For example, the variable ${alertDef.description} generates the alert definition description from an AlertDefinitionInterface class.

You append the variable for the required field to the variable of class that provides it, using a dot (.) separator to specify the variable for a field.

For data about...

from this class...

use this class variable

and a field variable...

resulting in...

The alert definition for the fired alert

AlertDefinitionInterface

alertDef

description
id
name
priority
alertDef.description
alertDef.id
alertDef.name
alertDef.priority

The fired alert

AlertInterface

alert

id
timestamp
alert.id
alert.timestamp

Alert actions

ActionExecutionInfo

action

longReason
shortReason
action.longReason
action.shortReason

Resource that fired the alert

Resource

resource

instanceid
mtime
owner
prototype
resourceType
resource.instanceid
resource.mtime
resource.owner
resource.prototype
resource.resourceType

Notification recipients

AuthzSubject

user

active
department
emailAddress
firstName
fullName
htmlEmail
lastName
phoneNumber
smsAddress
user.active
user.department
user.emailAddress
user.firstName
user.fullName
user.htmlEmail
user.lastName
user.phoneNumber
user.smsAddress

Status of an alert. Can be used only in subject.gsp

No class variable required

status

status

Whether an escalation action is an SMS notification. Can be used only in subject.gsp

No class variable required

IsSms

IsSms