Tailor Alert Notification Templates

Topics marked with * relate to features available only in vFabric Hyperic.

Groovy Server Pages Define Notification Content and Format

The content and format of alert notifications are governed by Groovy Server Pages in \server-n.n.n-EE\hq-engine\hq-server\webapps\ROOT\WEB-INF\alertTemplates.

  • 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

The following sections describe the content of each type of notification.

Email Notifications

Recipients can be specific HQ users, all HQ users with a given role, or external recipients. Email to an HQ user is sent in the mail format specified in the user's HQ user profile.

Email Notification Subject Line

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.

[HQ] ${priority} - ${alertDef.name} ${resource.name} ${status}

For example, this subject line:

[HQ]!! - High Disk Usage saint Win32 File System R:(remote/NTFS)

notifies the recipients of a medium priority alert named "High Disk Usage" that was triggered for the resource whose name is "saint Win32 File System R:\ (remote/NTFS)".

Email Notification Body

The body of the alert notification provides these details:

  • Resource name

  • Alert name

  • Alert date/time

  • Triggering condition, for instance, the threshold value for the alert and the actual value that triggered the alert

  • Alert severity

  • For an Alert on a individual resource, the last value of the each of the resource's indicator metrics before the alert was triggered

  • For group alerts, an "Additional Information" section that lists the group's specific member resources that triggered the alert and a link to a metric chart showing the triggering metric values

  • A link to the alert detail in the Hyperic user interface.

Variables Available for Notification Templates

The table below lists the alert-related class fields you can reference as variables in the .gsp templates that govern the content of alert notifications.

You can insert a variable of this form:

$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, this variable

${alertDef.description}

renders the alert definition description from an AlertDefinitionInterface class.

Append the variable for the desired field to the variable of class that provides it, with 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
Note: May be used only in subject.gsp.

 

no class variable required

status

status

whether an escalation action is an SMS notfication
Note: May be used only in subject.gsp.

 

no class variable required

IsSms

IsSms