WebLogic SNMP to monitor JDBC Connection Pool

Configuring WebLogic SNMP to monitor JBDC Connection Pool attributes using Gauge Monitor.

SNMP: It is basically Internet Protocol used to manage the devices over the IP based Network. The devices could be servers ,routers, printers, switches etc.

WebLogic Server software includes the ability to communicate with enterprise-wide management systems using Simple Network Management Protocol (SNMP). The WebLogic Server SNMP capability enables you to integrate management of WebLogic Servers into an SNMP-compliant management system. Such a system provides a single view of the various software and hardware resources of a complex, distributed system.

The below article demonstrates of how to configure a simple SNMP Gauge monitor to monitor the JDBC Connection pool attribute “ActiveConnectionsHighCount”  value within a specified range and generate the SNMP traps accordingly.

For example, we can check whether the  ActiveConnectionsHighCount of the Connection Pool operates within a range of Max and Min threshold values and generate trap notifications accordingly.

The steps are as below.

1. Creating SNMP agent.

2. Creating SNMP Gauge Monitor

3. Creating SNMP Trap Destination.

4. Verifying the SNMP Alerts.

1. Creating SNMP Agent:

a. Login into the Administration Console, navigate to Diagnostics → SNMP.

Click on New tab to create a Server SNMP Agent

b. Click on the newly created SNMP Agent → Enable the SNMP agent and you can modify the default SNMP agent attributes like SNMP ports etc.

c.Target the SNMP Agent to the Managed Server MS1.

2. Creating SNMP Gauge Monitor:

Gauge Monitor:

A gauge monitor observes changes in MBean attributes that are expressed as integers or floating-point.

You can specify that a notification is generated if an attribute is beyond the bounds of a high or low threshold value.

There are other different Monitors that can be set along side Gauge Monitor.

String Monitor:  A string monitor observes changes in attributes that are expressed as String Objects.

For further reference on the same refer the below post.

https://weblogic-wonders.com/weblogic/2010/12/17/weblogic-snmp-for-string-monitor/

a.Click on Gauge Monitor tab from the console.

b. From the drop down list of Mbeans, select  ‘JDBCConnectionPoolRuntime‘ Mbean

c. Select the ActiveConnectionsHighCount attribute from the drop down list.

d. Enter the threshold values for Max and Min number to specify the range for ActiveConnectionsHighCount attribute.

e. Click on the newly created Gauge Monitor and specify which DataSource Mbean you want to monitor (DS), polling interval of the MBeans.

f. Target the created Counter Monitor to the Managed server MS1.

3. Creating SNMP Trap Destination:

a. Click SNMP Agent –>  Trap Destinations –>  New.

b. Specify the Trap Destination attributes like Host and Ports.

4. Verify the SNMP Traps:

To verify that a WebLogic Server SNMP Agent is generating and sending notifications, we can use the WebLogic command line utility SnmpTrapMonitor.

a. Open a command prompt and set the classpath to the weblogic.jar file under the %WLS_HOME%/lib folder.

set classpath=%classpath%;%WLS_HOME%serverlibweblogic.jar

b. Run the weblogic command line utility weblogic.diagnostics.snmp.cmdline.Manager SnmpTrapMonitor to receive notifications.

Make sure that you specify the same listen port for this Trap Monitor as the trap destination that you created for the SNMP Agent.

For example, if your trap destination specifies a listen port of 171, enter the following command: java

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

The SNMP setup is complete. The config.xml file would like below.

**********************************************************************

 

<snmp-gauge-monitor>

<name>SNMPGaugeMonitor-0</name>

<enabled-server>MS1</enabled-server>

<monitored-m-bean-type>JDBCConnectionPoolRuntime</monitored-m-bean-type>

<monitored-m-bean-name>JDBC Data Source-0</monitored-m-bean-name>

<monitored-attribute-name>ActiveConnectionsHighCount</monitored-attribute-name>

<polling-interval>10</polling-interval>

<threshold-high>20</threshold-high>

<threshold-low>10</threshold-low>

</snmp-gauge-monitor>

 

**********************************************************************

If the ActiveConnectionsHighCount value exceeds / falls below the threshold values of the DataSource Connection Pool would generate Traps on to the listener as below.

From the command line utility:

**********************************************************************

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

RawTrapOID     : 1.3.6.1.4.1.140.625.0.75
Trap Objects   : {
{ enterprises.140.625.100.5=Sun Dec 19 20:52:36 IST 2010 }
{ enterprises.140.625.100.10=MS1 }
{ enterprises.140.625.100.55=jmx.monitor.gauge.low }
{ enterprises.140.625.100.60=2 }
{ enterprises.140.625.100.65=0 }
{ enterprises.140.625.100.70=com.bea:Name=JDBC Data Source-0,ServerRuntime=MS
1,Type=JDBCConnectionPoolRuntime }
{ enterprises.140.625.100.75=JDBCConnectionPoolRuntime }
{ enterprises.140.625.100.80=ActiveConnectionsHighCount }
}
**********************************************************************

From the Managed server console or server logs.

<Notice> <SNMP> <BEA-320931> <The SNMP trap version is 1>

For further references:

http://download.oracle.com/docs/cd/E13222_01/wls/docs103/snmpman/index.html

Best Regards,

Wonders Team. 🙂

6 comments

  1. Hello

    I have weblogic 9.2MP3 where in i dont have “java weblogic.diagnostics.snmp.cmdline.Manager SnmpTrapMonitor -p 171” this option.
    How should i verify the SNMP trap?

    Thanks
    Sumit

    1. Hi Sumit,

      It seems that the weblogic.diagnostics.snmp.cmdline.Manager class has been introduced from WebLogic 10.0 onwards. However for WebLogic 9.2 we can make use of utilities like snmptrapd, snmpget, snmpwalk and snmpgetnext classes.

      Snmptrapd usage:

      1. Set the classpath to weblogic.jar file.

      WL_HOME\server\bin\setWLSEnv.sh (or setWLSEnv.cmd on Windows)

      2. Run the class snmptrapd as below.

      G:\>java snmptrapd -p 165

      ****************************************
      Trap received from: /127.0.0.1, community: public
      Enterprise: .1.3.6.1.4.1.140.625
      Agent: /172.18.22.87
      TRAP_TYPE: 6
      SPECIFIC NUMBER: 0
      Time: 6
      VARBINDS:

      Trap received from: /127.0.0.1, community: public
      Enterprise: .1.3.6.1.4.1.140.625
      Agent: /172.18.22.87
      TRAP_TYPE: 6
      SPECIFIC NUMBER: 65
      Time: 135
      VARBINDS:
      Object ID: .1.3.6.1.4.1.140.625.100.5
      STRING: Dec 20, 2010 8:27:10 PM
      Object ID: .1.3.6.1.4.1.140.625.100.10
      STRING: AdminServer
      ****************************************

      Similarly we can make use of other generic SNMP command line utilities like snmpget, snmpwalk etc.

      Refer the below link for more details on the same.

      http://docs.sun.com/source/820-6413-13/SNMP_commands_reference_appendix.html
      http://download.oracle.com/docs/cd/E13222_01/wls/docs81/admin_ref/snmpcli2.html

      These command would require to specify the MIB Object Identifier (OID) details.

      Refer the below link for details for WLS9.2 MIB references.
      http://download.oracle.com/docs/cd/E13222_01/wls/docs92/snmp/index.html

      Do let us know, if you run into any issues.

      Best Regards,
      Wonders Team. 🙂

  2. Hi wonders team,

    Thank you for providing lucid examples.I wonder if there is any way we can configure SNMP to send alerts when the number of “active excute threads” and Execute thread Total counts” increases from a pre-defined value for a managed server?

    Generally i keep a eye on threads manually by going
    Servers->managed servers->Monitoring->threads

    Thank you,
    Joe

  3. Hello

    after deployment while testing application got the error like A connection to the server has failed.(status=12029) please help regarding that error. Even i have Restarted Admin server and Managed server for clear CACHE. still same problem.plz let me know solution.My weblogic server 10.3.5 and OS is LINUX

    Prasad

    1. Hi Prasad,

      Where do you see this error?
      Is it on the browser?
      Do you see any exception in the server logs?
      How did you deploy the application?

      Thanks

Comments are closed.