WebLogic SNMP to monitor JMS Server

Configuring WebLogic SNMP to monitor JMS Server attributes using Counter 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 WebLogic SNMP can be used to monitor the JMSServerRuntime Mbean attributes using Counter Monitor.

In the below example , we would check whether the  ‘MessagesCurrentCount‘ of the JMS Server exceeds the specified threshold and generate trap notifications accordingly.

Before we configure the SNMP Counter Monitor, make sure the JMS Server and Queue is properly configured.

Refer the below article to configure the JMS Queue.

https://weblogic-wonders.com/weblogic/2010/11/30/weblogic-jms-feature-using-a-queue/

The steps to configure Counter Monitor are as below.

1. Creating SNMP agent.

2. Creating SNMP Counter 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 AdminServer .

2. Create SNMP Counter Monitor:

Counter Monitor:

A counter monitor observes attribute values that are returned as an Integer object type.

You can specify that a trap is generated if an attribute is beyond the bounds of a threshold value. You can also specify that if a value exceeds a threshold, the monitor increases the threshold by an offset value. Each time the observed attribute exceeds the new threshold, the threshold is increased by the offset value, up to a maximum allowable threshold that you specify.

There are other different monitors that can be set along side Counter 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/

Gauge Monitor: A Gauge Monitor indicates whether  an attribute is operating within a specific range.

For further reference on the same refer the below post.

https://weblogic-wonders.com/weblogic/2010/12/19/weblogic-snmp-to-monitor-jdbc-connection-pool/

a.Click on Counter Monitor tab from the console.

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

c. Select the MessagesCurrentCount‘ attribute from the drop down list.

d. Enter the threshold value for MessagesCurrentCount attribute exceeding which will generate SNMP Traps.

e. Click on the newly created Counter Monitor and specify which JMSServer Mbean you want to monitor (JMSServer-0), polling interval of the MBeans.

f. Target the created Counter Monitor to the AdminServer.

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-counter-monitor>

<name>SNMPCounterMonitor-0</name>

<enabled-server>AdminServer</enabled-server>

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

<monitored-m-bean-name>JMSServer-0</monitored-m-bean-name>

<monitored-attribute-name>MessagesCurrentCount</monitored-attribute-name>

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

<threshold>10</threshold>

<offset>0</offset>

<modulus>0</modulus>

</snmp-counter-monitor>

 

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

If the MessagesCurrentCount value exceeds the threshold value of the JMSServer would generate Traps on to the listener as below.

From the command line utility:

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

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

— Snmp Trap Received —
Version        : v1
Source         : UdpEntity:127.0.0.1:161
Community      : public
Enterprise     : enterprises.140.625
TrapOID        : enterprises.140.625.0.75
RawTrapOID     : 1.3.6.1.4.1.140.625.0.75
Trap Objects   : {
{ enterprises.140.625.100.5=Mon Dec 20 15:42:45 IST 2010 }
{ enterprises.140.625.100.10=AdminServer }
{ enterprises.140.625.100.55=jmx.monitor.counter.threshold }
{ enterprises.140.625.100.60=10 }
{ enterprises.140.625.100.65=11 }
{ enterprises.140.625.100.70=com.bea:Location=AdminServer,Name=JMSServer-0,ServerRuntime=AdminServer,Type=JMSServerRuntime }
{ enterprises.140.625.100.75=JMSServerRuntime }
{ enterprises.140.625.100.80=MessagesCurrentCount }
}
**********************************************************************

From the Admin  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. 🙂