Configuring Log Watches Configuring Instrumentation Watches

9-4 Configuring and Using the Diagnostics Framework for Oracle WebLogic Server watch namesimpleWebLogicMBeanWatchRepeatingAfterWaitname enabledtrueenabled rule-typeHarvesterrule-type rule-expression {mydomain:Name=WLDFHarvesterRuntime,ServerRuntime=myserver,Type= WLDFHarvesterRuntime,WLDFRuntime=WLDFRuntimeTotalSamplingTime} gt;= 100 AND {mydomain:Name=myserver,Type= ServerRuntimeOpenSocketsCurrentCount} gt; 0 OR {mydomain:Name=WLDFWatchNotificationRuntime,ServerRuntime= myserver,Type=WLDFWatchNotificationRuntime, WLDFRuntime=WLDFRuntimeEnabled} = true OR {myCustomDomain:Name=myCustomMBean3State} = active rule-expression severityWarningseverity alarm-typeAutomaticResetalarm-type alarm-reset-period10000alarm-reset-period notificationmyJMXNotif,myImageNotif, myJMSTopicNotif,myJMSQueueNotif,mySNMPNotif, mySMTPNotifnotification watch -- Other watch-notification configuration elements -- watch-notification wldf-resource This watch uses an alarm type of AutomaticReset, which means that it may be triggered repeatedly, provided that the last time it was triggered was longer than the interval set as the alarm reset period in this case 10000 milliseconds. The severity level provided, Warning, has no effect on the triggering of the watch, but will be passed on through the notifications.

9.4 Configuring Log Watches

Use Log watches to monitor the occurrence of specific messages andor strings in the server log. Watches of this type are triggered as a result of a log message containing the specified data being issued. An example configuration for a log watch is shown in Example 9–2 . Example 9–2 Sample Configuration for a Log Watch in DIAG_MODULE.xml wldf-resource xmlns=http:xmlns.oracle.comweblogicweblogic-diagnostics xmlns:xsi=http:www.w3.org2001XMLSchema-instance xsi:schemaLocation=http:xmlns.oracle.comweblogicweblogic-diagnostics1.0webl ogic-diagnostics.xsd namemywldf1name watch-notification enabledtrueenabled log-watch-severityInfolog-watch-severity watch namemyLogWatchname rule-typeLogrule-type rule-expressionMSGID=BEA-000360rule-expression Configuring Watches 9-5 severityInfoseverity notificationmyMailNotif2notification watch smtp-notification namemyMailNotif2name enabledtrueenabled mail-session-jndi-namemyMailSessionmail-session-jndi-name subjectThis is a log alertsubject recipientusernameemailservice.comrecipient smtp-notification watch-notification wldf-resource

9.5 Configuring Instrumentation Watches

You use Instrumentation watches to monitor the events from the WLDF Instrumentation component. Watches of this type are triggered as a result of the event being posted. Example 9–3 shows an example configuration for an Instrumentation watch. Example 9–3 Sample Configuration for an Instrumentation Watch in DIAG_ MODULE.xml watch-notification watch namemyInstWatchname enabledtrueenabled rule-typeEventDatarule-type rule-expression PAYLOAD gt; 100000000 AND MONITOR = Servlet_Around_Service rule-expression alarm-type xsi:nil=truealarm-type notificationmySMTPNotificationnotification watch smtp-notification namemySMTPNotificationname enabledtrueenabled mail-session-jndi-namemyMailSessionmail-session-jndi-name subject xsi:nil=truesubject body xsi:nil=truebody recipientusernameemailservice.comrecipient smtp-notification watch-notification

9.6 Defining Watch Rule Expressions