Creating a notification template

Using the WebSphere® Application Server administrative console, you can create a notification template.

Before you begin

Before you begin this task, you must log in to the WebSphere Application Server administrative console.

About this task

Notifications are sent based on the action service templates that are configured. You can create a notification template specific to the notifications you want to configure.

To create a notification template, complete the following steps:

Procedure

  1. From the WebSphere Application Server administrative console, click Applications > Monitor Services > Monitor Action Services > Template Definitions > Notifications.
  2. Click New.
  3. Enter a template name. Each template name must be unique.
  4. Optional: Enter a description.
  5. In the Default action service type field, select one of the following options:
    • Dashboard alert
    • Cell phone
    • Email
    • Pager
  6. In the 'To' query type field, select one of the following options to specify which sort of query must be entered in the To field:
    • Federated repositories query. If you select this option, a valid federated repositories query must be entered in the To field.
    • LDAP query. If you select this option, a valid Lightweight Directory Access Protocol (LDAP) query must be entered in the To field.
    • Email address. If you select this option, a list of email addresses separated by spaces must be entered in the To field.
    • User ID. If you select this option, a list of user IDs separated by spaces must be entered in the To field.

    When this template is bound to a situation event, the users that are returned from the defined query or the list of users or email addresses are notified about the situation event. If a group contains a group, users that are members of the nested group are not notified.

    If you do not want to have any user notified by default about the situation event, leave the To field empty. Users are able to subscribe to the situation event notification through the dashboard.

  7. Depending on what you selected in the previous step, enter, in the To field, an LDAP or a federated repositories query that will be used to retrieve the set of users who will receive this notification. You can also enter a space-separated list of email addresses or user IDs if that is what was selected in the previous step. Here are two simple examples of federated repositories queries:
    @xsi:type='PersonAccount' and uid='employee1'
    @xsi:type='Group' and cn='AlertGroup'
  8. In the Query base field, enter the query base. These variables map to the federated repositories base or LDAP root used with the query.
  9. In the Owner field, enter the default owner for this template. The owner receives a notification if no users are subscribed to the notification.
  10. In the Priority field, indicate the priority for the notification. When you view notifications in the Alert Manager widget, you can view and change the priority, and you can sort the notifications by priority. If you do not enter a value in this field, the default value of 3 is used.
  11. In the Subject field, enter the subject text for a notification, using variables or XPath queries The variables correspond to Common Base Event data fields and are identified with surrounding percent signs (for example, %CBEVARIABLE%). XPath Queries can be used to reference any of the data within the Common Base Event XML and are identified with two percent signs at the start and one at the end (for example, %%XPATH%). The prefix-namespace mappings used in the XPath are defined on the Template XML Namespaces properties page.

    If you need to display a percent sign anywhere in the text, precede it with the pound sign (#). For example, #% is evaluated as %, and ## is evaluated as #.

    The following examples evaluate to the same result:
    The BSN is %BusinessSituationName%. 
    The BSN is 
    %%cbe:CommonBaseEvents/cbe:CommonBaseEvent/cbe:extendedDataElements[@name='BusinessSituationName']/cbe:values/text()
    %.
  12. In the Body field, enter the body of the notification message. Variable substitution can be used in this field to extract data from Common Base Event data fields. These variables map to Common Base Event data fields and are identified with surrounding percent signs, such as %CBEVARIABLE%. Surrounding percent signs (% ... %) can also be used to denote an XPATH expression that is used to similarly extract data from the Common Base Event data fields and place it in this field.

    The escape character to display a percent sign is #.

  13. Click Apply or OK to save changes to the master configuration. To prevent changes being lost, you must save the changes before you can change the panels.
    Note: If no user repository is configured or if information for a user cannot be found in the user repository when the template is created and bound, no subscription is created, and a warning is generated. You can safely ignore this warning. If enough information is available to send notifications, you will still receive the notifications even if no subscription is created.