Hi,
Jay SenSharma

Jay SenSharma

Based on a requirement of a  user named Shashi_sr on Oracle Forums we have created this post. Getting Alert is one of the most important  requirement in production environments. We can use many techinques to get alerts regarding the behaviour and scenario of WebLogic Server. WLST, JMX and WLDF are the most common techniques to monitor our WebLogic server resources and the health check of these resources.

Here we are going to see a very simple example of creating  a STUCK THREAD alert using SNMP Log Filters.  So that as soon as any thread will be declared by WebLogic  as STUCK we will immediately get an SNMP Alert.

You can also do the same thing using WLST script have a look at the post –  Sending Email Alert For Stuck Threads With Thread Dumps

Step1). Login to AdminConsole and then nevigate to “Diagnostics————> SNMP”

Step2). Now create an SNMP Agent like following:

Name: StuckThreadSNMPAgent
Enabled: true
Targeted Servers: AdminServer
UDP Port : 161
Community Prefix: public
Send Automatic Traps Enabled : true
Community Based Access Enabled : true
Inform Retry Interval : 10000
Maximum Inform Retry Count : 1
Credential Cache Invalidation Interval : 3600000
LogFilter_StuckThread_1

LogFilter_StuckThread_1

Step3). Now create a Log Filter  By clicking on

“Diagnostics—->SNMP—–>StuckThreadSNMPAgent—–>Configuration (Tab)—–>Log Filters”
like following:
Name: StuckThreadLogFilter
Enabled Servers: AdminServer
Severity Level: Error
Subsystem Names: WebLogicServer
Message IDs : 000337
Message Substring : [STUCK] ExecuteThread
Like following:
LogFilter_StuckThread_2

LogFilter_StuckThread_2

Step4). Now  Create a Trap Destination like following:

“Diagnostics—->SNMP—–>StuckThreadSNMPAgent—–>Configuration (Tab)—–>Trap Destinations”
Name: StuckThreadTrapDest
Community: public
Host: localhost
Port : 165
as following:
LogFilter_StuckThread_3

LogFilter_StuckThread_3

Step5). Now restart your Server  Just to make sure that every thing is OK.

Step6). Now open a command prompt and then run “setWLSEnv.cmd”/ setWLSEnv.sh  then start the

java weblogic.diagnostics.snmp.cmdline.Manager SnmpTrapMonitor -p 165

LogFilter_StuckThread_4

LogFilter_StuckThread_4

As soon as you will get any STUCK THREAD you will get an alert immediately as following:

LogFilter_StuckThread_5

LogFilter_StuckThread_5

.
.
Thank
Jay SenSharma
If you enjoyed this post, please considerleaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.