Skip Headers
Oracle® Fusion Middleware Configuring and Using the Diagnostics Framework for Oracle WebLogic Server
12c Release 1 (12.1.1)

Part Number E24426-02
Go to Documentation Home
Home
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

10 Configuring Notifications

This chapter describes the types of notifications available in the WebLogic Diagnostics Framework (WLDF) and their configuration options.

This chapter includes the following sections:

For information about how to create a notification using the Administration Console, see "Create notifications for watches in a diagnostic system module" in Oracle WebLogic Server Administration Console Online Help.

Types of Notifications

A notification is an action that is triggered when a watch rule evaluates to true. WLDF supports four types of diagnostic notifications, based on the delivery mechanism: Java Management Extensions (JMX), Java Message Service (JMS), Simple Mail Transfer Protocol (SMTP), and Simple Network Management Protocol (SNMP). You can also create a notification that generates a diagnostic image.

In the configuration file for a diagnostic module, the different types of notifications are identified by these elements:

These notification types all have <name> and <enabled> configuration options. The value of <name> is used as the value in a <notification> element for a watch, to map the watch to its corresponding notification(s). The <enabled> element, when set to true, enables that notification. In other words, the notification is fired when an associated watch evaluates to true. Other than <name> and <enabled>, each notification type is unique.

Note:

To define notifications programmatically, use weblogic.diagnostics.watch.WatchNotification.

Configuring JMX Notifications

For each defined JMX notification, WLDF issues JMX events (notifications) whenever an associated watch is triggered. Applications can register a notification listener with the server's WLDFWatchJMXNotificationRuntimeMBeans to receive all notifications and filter the provided output. You can also specify a JMX "notification type" string that a JMX client can use as a filter.

Example 10-1 shows an example of a JMX notification configuration.

Example 10-1 Example Configuration for a JMX Notification

<wldf-resource xmlns="http://xmlns.oracle.com/weblogic/weblogic-diagnostics" 
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
   xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-diagnostics/1.0/weblogic-diagnostics.xsd">
  <name>mywldf1</name> 
  <watch-notification>
    <!-- One or more watch configurations -->
    <jmx-notification>
      <name>myJMXNotif</name>
      <enabled>true</enabled>
    </jmx-notification>
    <!-- Other notification configurations -->
  </watch-notification>
</wldf-resource>

Here is an example of a JMX notification:

Notification name:    myjmx called. Count= 42.
 Watch severity:         Notice
 Watch time:             Jul 19, 2005 3:40:38 PM EDT
 Watch ServerName:       myserver
 Watch RuleType:         Harvester
 Watch Rule:               ${com.bea:Name=myserver,Type=ServerRuntime//OpenSocketsCurrentCount} > 1
 Watch Name:             mywatch
 Watch DomainName:       mydomain
 Watch AlarmType:        None
 Watch AlarmResetPeriod: 10000

Configuring JMS Notifications

JMS notifications are used to post messages to JMS topics and/or queues in response to the triggering of an associated watch. In the system resource configuration file, the elements <destination-jndi-name> and <connection-factory-jndi-name> define how the message is to be delivered.

Example 10-2 shows two JMS notifications that cause JMS messages to be sent through the provided topics and queues using the specified connection factory. For this to work properly, JMS must be properly configured in the config.xml configuration file for the domain, and the JMS resource must be targeted to this server.

Example 10-2 Example JMS Notifications

<wldf-resource xmlns="http://xmlns.oracle.com/weblogic/weblogic-diagnostics" 
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
   xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-diagnostics/1.0/weblogic-diagnostics.xsd">
  <name>mywldf1</name> 
  <watch-notification>
    <!-- One or more watch configurations -->
    <jms-notification>
      <name>myJMSTopicNotif</name>
      <destination-jndi-name>MyJMSTopic</destination-jndi-name>
      <connection-factory-jndi-name>weblogic.jms.ConnectionFactory
           </connection-factory-jndi-name>
    </jms-notification>
    <jms-notification>
      <name>myJMSQueueNotif</name>
      <destination-jndi-name>MyJMSQueue</destination-jndi-name>
      <connection-factory-jndi-name>weblogic.jms.ConnectionFactory
          </connection-factory-jndi-name>
    </jms-notification>
    <!-- Other notification configurations -->
  </watch-notification>
</wldf-resource>

The content of the notification message gives details of the watch and notification.

Configuring SNMP Notifications

Simple Network Management Protocol (SNMP) notifications are used to post SNMP traps in response to the triggering of an associated watch. To define an SNMP notification you only have to provide a notification name, as shown in Example 10-3. Generated traps contain the names of both the watch and notification that caused the trap to be generated. For an SNMP trap to work properly, SNMP must be properly configured in the config.xml configuration file for the domain.

Example 10-3 An Example Configuration for an SNMP Notification

<wldf-resource xmlns="http://xmlns.oracle.com/weblogic/weblogic-diagnostics" 
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
   xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-diagnostics/1.0/weblogic-diagnostics.xsd">
  <name>mywldf1</name> 
  <watch-notification>
    <!-- One or more watch configurations -->
    <snmp-notification>
      <name>mySNMPNotif</name>
    </snmp-notification>
    <!-- Other notification configurations -->
  </watch-notification>
</wldf-resource>

The trap resulting from the SNMP notification configuration shown in Example 10-3 is of type 85. It contains the following values (configured values are shown in angle brackets "<>"):

.1.3.6.1.4.1.140.625.100.5   timestamp (e.g. Dec 9, 2004 6:46:37 PM EST
    .1.3.6.1.4.1.140.625.100.145  domainName (e.g. mydomain")
    .1.3.6.1.4.1.140.625.100.10   serverName (e.g. myserver)
    .1.3.6.1.4.1.140.625.100.120  <severity> (e.g. Notice)
    .1.3.6.1.4.1.140.625.100.105  <name> [of watch] (e.g.
          simpleWebLogicMBeanWatchRepeatingAfterWait)
    .1.3.6.1.4.1.140.625.100.110  <rule-type> (e.g. HarvesterRule)
    .1.3.6.1.4.1.140.625.100.115  <rule-expression>
    .1.3.6.1.4.1.140.625.100.125  values which caused rule to 
        fire (e.g..State =
        null,weblogic.management.runtime.WLDFHarvesterRuntimeMBean.
        TotalSamplingTime = 886,.Enabled =
        null,weblogic.management.runtime.ServerRuntimeMBean.
    OpenSocketsCurrentCount = 1,)
    .1.3.6.1.4.1.140.625.100.130  <alarm-type> (e.g. None)
    .1.3.6.1.4.1.140.625.100.135  <alarm-reset-period> (e.g. 10000)
    .1.3.6.1.4.1.140.625.100.140  <name> [of notification] 
                                   (e.g.mySNMPNotif)

Configuring SMTP Notifications

Simple Mail Transfer Protocol (SMTP) notifications are used to send messages (e-mail) over the SMTP protocol in response to the triggering of an associated watch. To define an SMTP notification, first configure the SMTP session. That configuration is persisted in the config.xml configuration file for the domain. In DIAG_MODULE.xml, you provide the configured SMTP session using sub-element <mail-session-jndi-name>, and provide a list of at least one recipient using sub-element <recipients>. An optional subject and/or body can be provided using sub-elements <subject> and <body> respectively. If these are not provided, they will be defaulted.

Example 10-4 shows an SMTP notification that causes an SMTP (e-mail) message to be distributed through the configured SMTP session, to the configured recipients. In this notification configuration, a custom subject and body are provided. If a subject and/or a body are not specified, defaults are provided, showing details of the watch and notification.

Example 10-4 Sample Configuration for SMTP Notification (in DIAG_MODULE.xml)

<wldf-resource xmlns="http://xmlns.oracle.com/weblogic/weblogic-diagnostics" 
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
   xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-diagnostics/1.0/weblogic-diagnostics.xsd">
  <name>mywldf1</name> 
  <watch-notification>
    <!-- One or more watch configurations -->
    <smtp-notification>
      <name>mySMTPNotif</name>
      <mail-session-jndi-name>MyMailSession</mail-session-jndi-name>
      <subject>Critical Problem!</subject>
      <body>A system issue occurred. Call Winston ASAP. 
           Reference number 81767366662AG-USA23.</body>
      <recipients>administrator@myCompany.com</recipients>
    </smtp-notification>
    <!-- Other notification configurations -->
  </watch-notification>
</wldf-resource>

The content of the notification message gives details of the watch and notification.

Configuring Image Notifications

An image notification causes a diagnostic image to be generated in response to the triggering of an associated watch. You can configure two options for image notifications: a directory and a lockout period.

The directory name indicates where images will be generated. The lockout period determines the number of seconds that must elapse before a new image can be generated after the last one. This is useful for limiting the number of images that will be generated when there is a sequence of server failures and recoveries

You can specify the directory name relative to the DOMAIN_NAME\servers\SERVER_NAME, directory where DOMAIN_NAME is the name of the domain's home directory and SERVER_NAME is the name of the server. The default directory is DOMAIN_NAME\servers\SERVER_NAME\logs\diagnostic-images.

Image file names are generated using the current timestamp (for example, diagnostic_image_myserver_2005_08_09_13_40_34.zip), so a notification can fire many times, resulting in a separate image file each time.

The configuration is persisted in the DIAG_MODULE.xml configuration file. Example 10-5 shows an image notification configuration that specifies that the lockout time will be two minutes and that the image will be generated to the DOMAIN_NAME\servers\SERVER_NAME\images directory.

Example 10-5 Sample Configuration for Image Notification (in DIAG_MODULE.xml)

<wldf-resource xmlns="http://xmlns.oracle.com/weblogic/weblogic-diagnostics" 
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
   xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-diagnostics/1.0/weblogic-diagnostics.xsd">
  <name>mywldf1</name> 
  <watch-notification>
    <!-- One or more watch configurations -->
    <image-notification>
      <name>myImageNotif</name>
      <enabled>true</enabled>
      <image-lockout>2</image-lockout>
      <image-directory>images</image-directory>
    </image-notification>
    <!-- Other notification configurations -->
  </watch-notification>
</wldf-resource>

For more information about Diagnostic Images, see Chapter 5, "Configuring and Capturing Diagnostic Images."