Configuring and Using the WebLogic Diagnostics Framework

     Previous  Next    Open TOC in new window    View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Configuring Watches and Notifications

The Watch and Notification component of the WebLogic Diagnostic Framework (WLDF) provides the means for monitoring server and application states and then sending notifications based on criteria set in the watches.Watches and notifications are configured as part of a diagnostic module targeted to one or more server instances in a domain.

Watches and notifications are described in the following sections:


Watches and Notifications

A watch identifies a situation that you want to trap for monitoring or diagnostic purposes. You can configure watches to analyze log records, data events, and harvested metrics. A watch is specified as a watch rule, which includes:

A notification is an action that is taken when a watch rule expression evaluates to true. WLDF supports the following types of notifications:

You must associate a watch with a notification for a useful diagnostic activity to occur, for example, to notify an administrator about specified states or activities in a running server.

Watches and notifications are configured separately from each other. A notification can be associated with multiple watches, and a watch can be associated with multiple notifications. This provides the flexibility to recombine and re-use watches and notifications, according to current needs.


Overview of Watch and Notification Configuration

A complete watch and notification configuration includes settings for one or more watches, one or more notifications, and any underlying configurations required for the notification media, for example, the SNMP configuration required for an SNMP-based notification.

The main elements required for configuring watches and notifications in a WLDF system resource descriptor file, DIAG_MODULE.xml, are shown in Listing 7-1. As the listing shows, the base element for defining watches and notifications is <watch-notification>. Watches are defined in <watch> elements, and notifications are defined in elements named for each of the types of notification, for example <jms-notification>, <jmx-notification>, <smtp-notification>, and <image-notification>.

Listing 7-1 A Skeleton Watch and Notification Configuration (in DIAG_MODULE.xml)
<!-- ----- Other system resource configuration elements ----- -->
     <!-- Threshhold severity for a log watch to be evaluated further
           (This can be narrowed further at the watch level.) -->
    <!-- ----- Watch configuration elements: ----- -->
      <!-- A watch rule -->
      <!-- A watch rule -->
    <!-- Any other watch configurations -->
    <!-- ----- Notification configuration elements: ----- -->
    <!-- The following notification configuration elements show one of each 
         type of supported notifications. However, not all types are
         required in any one system resource configuration, and multiples
         of any type are permitted. -->
      <!-- Configuration for a JMS-based notification; requires a
           corresponding JMS configuration via a jms-server element and a
           jms-system-resource element -->
      <!-- Configuration for a JMX-based notification -->
      <!-- Configuration for an SMTP-based notification; requires a
           corresponding SMTP configuration via a mail-session element -->
      <!-- Configuration for an SNMP-based notification; requires a
           corresponding SNMP agent configuration via an snmp-agent
           element -->
      <!-- Configuration for an image-based notification -->
<!-- ----- Other configuration elements ----- -->
Note: While the notification media must be configured so they can be used by the notifications that depend on them, those configurations are not part of the configuration of the diagnostic module itself. That is, they are not configured in the <wldf-resource> element in the diagnostic module’s configuration file.

Each watch and notification can be individually enabled and disabled by setting <enabled>true</enabled> or <enabled>false</enabled> for the individual watch and/or notification. In addition, the entire watch and notification facility can be enabled and disabled by setting <enabled>true</enabled> or <enabled>false</enabled> for all watches and notifications. The default value is <enabled>true</enabled>.

The <watch-notification> element contains a <log-watch-severity> sub-element, which affects how notifications are triggered by log-rule watches.

If the maximum severity level of the log messages that triggered the watch do not at least equal the provided severity level, then the resulting notifications are not fired. Note that this only applies to notifications fired by watches which have log rule types. Do not confuse this element with the <severity> element defined on watches. The <severity> element assigns a severity to the watch itself, whereas the <log-watch-severity> element controls which notifications are triggered by log-rule watches.


Sample Watch and Notification Configuration

A complete configuration for a set of watches and notifications in a diagnostic module is shown in Listing 7-2. The details of this example are explained in the following two sections:

  Back to Top       Previous  Next