Thursday Dec 10, 2009

Yet another way to view v3 monitoring data - REST

I just covered viewing monitoring data with...
CLI
AMX MBeans (viewed with JConsole)
Admin Console

Here's yet a 4th way to get/view the v3 monitoring data - through the REST interface.

If you followed the earlier 1-2-3 steps,
in a browser, go to http://localhost:4848/monitoring/domain.

Start clicking through and you'll come to the same JVM statistics again...

v3 Monitoring with Admin Console

Here's what the JVM monitoring looks like through the Admin Console.
By the way, the Admin Console uses the AMX monitoring MBeans, as shown previously, to retrieve the data.

In the browser, go to http://localhost:4848.
Select Enterprise Server in the Tree on the left.
Click on the Monitor tab.
Click on Server sub-tab.
Click on JVM: Memory Statistics in the table to expand.

Here's a snapshot.

View AMX Monitoring MBeans in JConsole

Building on the previous entry '1-2-3 Monitoring', you can see the generated AMX Monitoring MBeans with JConsole.

If you have java in the system path, just type 'jconsole' on the command line.
In the 'New Connection' dialog, select 'Remote Process' and type in 'localhost:8686'.
Leave the Username and Password blank.

Now select the MBeans tab.
Expand the 'amx' folder. Any folder with a '-mon' suffix, will be a monitoring MBean. If you followed the previous steps to turn on JVM monitoring, you should see the JVM monitoring MBeans.
Expand the 'memory-mon' folder and '/mon/server-mon[server]' subfolder.
Click on 'jvm/memory'. You can see the ObjectName on the right side:
amx:pp=/mon/server-mon[server],type=memory-mon,name=jvm/memory.

Then select Attributes and on the right, double-click on one of the values 'javax.management.openmbean.CompositeDataSupport'. You will see the details of that statistic.

Here's a snapshot.

The ObjectNames for all the JVM Monitoring MBeans:
amx:pp=/mon/server-mon[server],type=class-loading-system-mon,name=jvm/class-loading-system
amx:pp=/mon/server-mon[server],type=memory-mon,name=jvm/memory
amx:pp=/mon/server-mon[server],type=compilation-system-mon,name=jvm/compilation-system
amx:pp=/mon/server-mon[server],type=garbage-collector-mon,name=jvm/garbage-collectors/Copy
amx:pp=/mon/server-mon[server],type=operating-system-mon,name=jvm/operating-system
amx:pp=/mon/server-mon[server],type=runtime-mon,name=jvm/runtime
amx:pp=/mon/server-mon[server],type=thread-system-mon,name=jvm/thread-system
amx:pp=/mon/server-mon[server],type=threadinfo-mon,name=jvm/thread-system/thread-10

The monitoring MBeans are created using the gmbal API (http://kenai.com/projects/gmbal).

The MBeans don't get created unless there's an RMI connection, such as when viewing through JConsole or using the Admin Console.

Easy 1-2-3 Monitoring in v3

1. See what's available for monitoring:
asadmin get server.monitoring-service.\*

2. Turn on monitoring (the output from step #1 will tell you the proper syntax for this set command):
asadmin set server.monitoring-service.module-monitoring-levels.{component}=HIGH

where {component} can be
connector-connection-pool
connector-service
ejb-container
http-service
jdbc-connection-pool
jersey
jms-service
jvm
orb
security
thread-pool
transaction-service
web-container

Example:
asadmin set server.monitoring-service.module-monitoring-levels.jvm=HIGH

Note: either LOW or HIGH will turn on monitoring; use OFF to disable it. Currently, only jvm will give different output for LOW vs. HIGH mode.

3. View statistics
asadmin get -m "\*"

You will see all the JVM statistics. If you don't want all the thread info, set the jvm level to LOW.
To see a subset of the JVM statistics, for example 'memory', you can refine the output:

asadmin get -m "server.jvm.memory.\*"

About

Jennifer Chou

Search

Categories
Archives
« December 2009 »
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
       
Today