Sun GlassFish Enterprise Server v2.1.1 Administration Guide

Viewing Monitoring Data

Viewing Monitoring Data in the Admin Console

In the developer profile, to view monitoring data, go to Application Server -> Monitor.

In the cluster and enterprise profiles, to view monitoring data for a stand-alone instance, go to Stand-Alone Instances -> Instance -> Monitor. To view monitoring data for a clustered instance, go to Clusters -> Cluster -> Instance -> Monitor.

You can select and view monitoring data for JVM, server, applications, thread pools, HTTP service, transaction service, log statistics, and call flow statistics. See The Tree Structure of Monitorable Objects.

For details on viewing or configuring monitoring, see the online help available with the Admin Console.

For more information on the attributes for each component or service, refer to Statistics for Monitored Components and Services.

Viewing Monitoring Data With the asadmin Tool

This section contains the following topics:

ProcedureTo Use the asadmin monitor Command to View Monitoring Data

asadmin has two ways of viewing monitoring data. The first is to use the monitor command. This command prints out the commonly-monitored statistics, and has options for filtering out statistics and capture the output in a Comma Separated Values (CSV) file.

  1. To view monitoring data, use the monitor command, and specify the type of monitoring data: httplistener, keepalive, filecache, connectionqueue, jdbcpool, jvm, threadpool, servlet, connection, connectorpool, endpoint, entitybean, messagedriven, statefulsession, statelesssession, httpservice, or webmodule.

    For example, to view data for jvm on server, enter the following:


    asadmin>monitor --type jvm --user adminuser server

                                   JVM Monitoring
    UpTime(ms)                                    HeapSize(bytes)    
    current                   min        max        low        high       count    
    327142979                 0          531628032  0          45940736   45940736  
  2. To view monitoring data and send the output to a CSV file, use the filename option. For example:


    asadmin> monitor --type jvm --filename myoutputfile --user adminuser server

ProcedureTo Use the asadmin get and list Commands to View Monitoring Data

The monitor command is useful in most situations. However, it does not offer the complete list of all monitorable objects. To view all monitorable data using the asadmin tool, use the asadmin list and asadmin get commands followed by the dotted name of a monitorable object, as follows.

  1. To view the names of the objects that can be monitored, use the asadmin list command.

    For example, to view a list of application components and subsystems that have monitoring enable for the server instance, type the following command in a terminal window:


    asadmin> list --user adminuser --monitor server

    The preceding command returns a list of application components and subsystems that have monitoring enabled, for example:


    server.resources
    server.connector-service
    server.orb
    server.jms-service
    server.jvm
    server.applications
    server.http-service
    server.sip-service
    server.thread-pools

    For further examples using the list command, refer to Examples of the list and get Commands. For further information on the dotted names you can use with the list command, refer to Understanding and Specifying Dotted Names.

  2. To display monitoring statistics for an application component or subsystem for which monitoring has been enabled, use the asadmin get command.

    To get the statistics, type the asadmin get command in a terminal window, specifying a name displayed by the list command in the preceding step. The following example attempts to get all attributes from a subsystem for a specific object:


    asadmin> get --user adminuser --monitor server.jvm.*

    The command returns the following attributes and data:


    server.jvm.dotted-name = server.jvm
    server.jvm.heapsize-current = 21241856
    server.jvm.heapsize-description = Provides statistical information about 
       the JVM's memory heap size.
    server.jvm.heapsize-highwatermark = 21241856
    server.jvm.heapsize-lastsampletime = 1080232913938
    server.jvm.heapsize-lowerbound = 0
    server.jvm.heapsize-lowwatermark = 0
    server.jvm.heapsize-name = JvmHeapSize
    server.jvm.heapsize-starttime = 1080234457308
    server.jvm.heapsize-unit = bytes
    server.jvm.heapsize-upperbound = 518979584
    server.jvm.uptime-count = 1080234457308
    server.jvm.uptime-description = Provides the amount of time the JVM has 
       been running.
    server.jvm.uptime-lastsampletime = 1080234457308
    server.jvm.uptime-name = JvmUpTime
    server.jvm.uptime-starttime = 1080232913928
    server.jvm.uptime-unit = milliseconds

    For further examples using the get command, refer to Examples of the list and get Commands. For further information on the dotted names you can use with the get command, refer to Understanding and Specifying Dotted Names.

Understanding and Specifying Dotted Names

In the asadmin list and get commands, specify the dotted name of monitorable objects. All child objects are addressed using the dot (.) character as separator, thus these are referred to as dotted names. If a child node is of singleton type, then only the monitoring object type is needed to address the object, otherwise a name of the form type.name is needed to address the object.

For example, http-service is one of the valid monitorable object types and is a singleton. To address a singleton child node representing the http-service of instance server, the dotted name is:

server.http-service

Another example, application, is a valid monitorable object type and is not a singleton. To address a non-singleton child node representing, for example, the application PetStore, the dotted name is:

server.applications.petstore

The dotted names can also address specific attributes in monitorable objects. For example, http-service has a monitorable attribute called bytesreceived-lastsampletime. The following name addresses the bytesreceived attribute:

server.http-service.server.http-listener-1.
  bytesreceived-lastsampletime

The administrator is not expected to know the valid dotted names for asadmin list and get commands. The list command displays available monitorable objects, while the get command used with a wildcard parameter allows the inspection of all available attributes on any monitorable object.

The underlying assumptions for using the list and get commands with dotted names are:

For more information, read Expected Output for list and get Commands at All Levels.

Examples of the list and get Commands

This section contains the following topics:

Examples for the list --user admin-user --monitor Command

The list command provides information about the application components and subsystems currently being monitored for the specified server instance name. Using this command, you can see the monitorable components and subcomponents for a server instance. For a more complete listing of list examples, see Expected Output for list and get Commands at All Levels.

Example 1


asadmin> list --user admin-user --monitor server

The preceding command returns a list of application components and subsystems that have monitoring enabled, for example:


server.resources
server.orb
server.jvm
server.jms-service
server.connector-service
server.applications
server.http-service
server.thread-pools

It is also possible to list applications that are currently monitored in the specified server instance. This is useful when particular monitoring statistics are sought from an application using the get command.

Example 2

asadmin> list --user admin-user --monitor server.applications

Returns:

server.applications.adminapp
 server.applications.admingui
server.applications.myApp

For a more comprehensive example, see To Use the PetStore Example.

Examples for the get --user admin-user --monitor Command

This command retrieves the following monitored information:

Example 1

Attempt to get all attributes from a subsystem for a specific object:


asadmin> get --user admin-user --monitor server.jvm.*

Returns:


server.jvm.dotted-name= server.jvm
server.jvm.heapsize-current = 21241856
server.jvm.heapsize-description = Provides statistical information about 
   the JVM's memory heap size.
server.jvm.heapsize-highwatermark = 21241856
server.jvm.heapsize-lastsampletime = 1080232913938
server.jvm.heapsize-lowerbound = 0
server.jvm.heapsize-lowwatermark = 0
server.jvm.heapsize-name = JvmHeapSize
server.jvm.heapsize-starttime = 1080234457308
server.jvm.heapsize-unit = bytes
server.jvm.heapsize-upperbound = 518979584
server.jvm.uptime-count = 1080234457308
server.jvm.uptime-description = Provides the amount of time the JVM has 
   been running.
server.jvm.uptime-lastsampletime = 1080234457308
server.jvm.uptime-name = JvmUpTime
server.jvm.uptime-starttime = 1080232913928
server.jvm.uptime-unit = milliseconds

Example 2

Attempt to get all attributes from a Java EE application:


asadmin> get --user admin-user --monitor server.applications.myJavaEEApp.*

Returns:


No matches resulted from the wildcard expression.
CLI137 Command get failed.

There are no monitorable attributes exposed at the Java-EE-application level, therefore this reply displays.

Example 3

Attempt to get a specific attribute from a subsystem:


asadmin> get --user admin-user --monitor server.jvm.uptime-lastsampletime

Returns:

server.jvm.uptime-lastsampletime = 1093215374813

Example 4

Attempt to get an unknown attribute from within a subsystem attribute:


asadmin> get --user admin-user --monitor server.jvm.badname

Returns:


No such attribute found from reflecting the corresponding Stats 
interface: [badname]
CLI137 Command get failed.

ProcedureTo Use the PetStore Example

The following example illustrates how the asadmin tool might be used for monitoring purposes.

A user wants to inspect the number of calls made to a method in the sample PetStore application after it has been deployed onto the Enterprise Server. The instance onto which it has been deployed is named server. A combination of the list and get commands are used to access desired statistics on a method.

  1. Start the Enterprise Server and the asadmin tool.

  2. Set some useful environment variables to avoid entering them for every command:


    asadmin> export AS_ADMIN_USER=admin AS_ADMIN_PASSWORD=admin123
    asadmin>export AS_ADMIN_HOST=localhost AS_ADMIN_PORT=4848
  3. List monitorable components for instance server:


    asadmin> list --user adminuser --monitor server*

    Returns (output will be similar to):


    server
    server.applications
    server.applications.CometEJB
    server.applications.ConverterApp
    server.applications.petstore
    server.http-service
    server.resources
    server.thread-pools

    The list of monitorable components includes thread-pools, http-service, resources, and all deployed (and enabled) applications.

  4. List the monitorable subcomponents in the PetStore application (-m can be used instead of --monitor):

    asadmin> list -m server.applications.petstore

    Returns:


    server.applications.petstore.signon-ejb_jar
    server.applications.petstore.catalog-ejb_jar
    server.applications.petstore.uidgen-ejb_jar
    server.applications.petstore.customer-ejb_jar
    server.applications.petstore.petstore-ejb_jar
    server.applications.petstore.petstore\.war
    server.applications.petstore.AsyncSenderJAR_jar
    server.applications.petstore.cart-ejb_jar
  5. List the monitorable subcomponents in the EJB module signon-ejb_jar of the PetStore application:


    asadmin> list -m server.applications.petstore.signon-ejb_jar

    Returns:


    server.applications.petstore.signon-ejb_jar.SignOnEJB
    server.applications.petstore.signon-ejb_jar.UserEJB
  6. List the monitorable subcomponents in the entity bean UserEJB for the EJB module signon-ejb_jar of the PetStore application:


    asadmin> list -m server.applications.petstore.signon-ejb_jar.UserEJB

    Returns (with dotted name removed for space considerations):


    server.applications.petstore.signon-ejb_jar.UserEJB.bean-cache
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-pool
  7. List the monitorable subcomponents in the method getUserName for the entity bean UserEJB in the EJB module signon-ejb_jar of the PetStore application:


    asadmin> list -m 
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.getUserName

    Returns:


    Nothing to list at server.applications.petstore.signon-ejb_jar.
    UserEJB.bean-methods.getUserName. To get the valid names beginning with a 
    string, use the wildcard "*" character. For example, to list all names 
    that begin with "server", use "list server*".
  8. There are no monitorable subcomponents for methods. Get all monitorable statistics for the method getUserName.


    asadmin> get -m 
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.getUserName.*

    Returns:


    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.executiontime-count = 0
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.executiontime-description = Provides the time in milliseconds 
       spent during the last successful/unsuccessful attempt to execute the 
       operation.
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.executiontime-lastsampletime = 1079981809259
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.executiontime-name = ExecutionTime
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.executiontime-starttime = 1079980593137
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.executiontime-unit = count
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.methodstatistic-count = 0
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.methodstatistic-description = Provides the number of times an 
       operation was called, the total time that was spent during the 
       invocation and so on.
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.methodstatistic-lastsampletime = 1079980593137
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.methodstatistic-maxtime = 0
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.methodstatistic-mintime = 0
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.methodstatistic-name = ExecutionTime
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.methodstatistic-starttime = 1079980593137
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.methodstatistic-totaltime = 0
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.methodstatistic-unit =
     server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.totalnumerrors-count = 0
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.totalnumerrors-description = Provides the total number of errors 
       that occured during invocation or execution of an operation.
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.totalnumerrors-lastsampletime = 1079981809273
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.totalnumerrors-name = TotalNumErrors
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.totalnumerrors-starttime = 1079980593137
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.totalnumerrors-unit = count
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.totalnumsuccess-count = 0
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.totalnumsuccess-description = Provides the total number of 
       successful invocations of the method.
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.totalnumsuccess-lastsampletime = 1079981809255
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.totalnumsuccess-name = TotalNumSuccess
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.totalnumsuccess-starttime = 1079980593137
    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.totalnumsuccess-unit = count
  9. To also get a specific statistic, such as execution time, use a command such as the following:


    asadmin> get -m server.applications.petstore.signon-ejb_jar.
    UserEJB.bean-methods.getUserName.executiontime-count

    Returns:


    server.applications.petstore.signon-ejb_jar.UserEJB.bean-methods.
    getUserName.executiontime-count = 1

Expected Output for list and get Commands at All Levels

The following tables show the command, dotted name, and corresponding output at each level of the tree.

Table 18–24 Top Level

Command 

Dotted Name 

Output 

list -m

server


server.applicationsserver.thread-poolsserver.
resourcesserver.http-serviceserver.transaction-
serviceserver.orb.connection-managersserver.orb.
connection-managers.orb\.Connections\.Inbound\.
AcceptedConnectionsserver.jvm

list -m

server.*

Hierarchy of child nodes below this node. 

get -m

server.*

No output except a message saying there are no attributes at this node. 

The following table shows the command, dotted name, and corresponding output for the applications level.

Table 18–25 Applications Level

Command 

Dotted Name 

Output 

list -m

server.applications

or 

*applications


appl1app2web-module1_warejb-module2_jar...

list -m

server.applications.*

or 

*applications.*

Hierarchy of child nodes below this node. 

get -m

server.applications.*

or 

*applications.*

No output except message saying there are no attributes at this node. 

The following table shows the command, dotted name, and corresponding output for stand-alone modules and enterprise applications at the applications level.

Table 18–26 Applications - Enterprise Applications and Standalone Modules

Command 

Dotted Name 

Output 

list -m

server.applications.app1

or 

*app1

Note: this level is only applicable if an enterprise application has been deployed. It is not applicable if a standalone module is deployed. 

ejb-module1_jarweb-module2_warejb-module3_jarweb-module3_war...

list -m

server.applications.app1.*

or 

*app1.*

Hierarchy of child nodes below this node. 

get -m

server.applications.app1.*

or 

*app1.*

No output except message saying there are no attributes at this node. 

list -m

server.applications.app1.ejb-module1_jar

or 

*ejb-module1_jar

or 

server.applications.ejb-module1_jar

bean1bean2bean3...

list -m

server.applications.app1.ejb-module1_jar

or 

*ejb-module1_jar

or 

server.applications.ejb-module1_jar

Hierarchy of child nodes below this node. 

get -m

server.applications.app1.ejb-module1_jar.*

or 

*ejb-module1_jar.*

or 

server.applications.ejb-module1_jar.*

No output except message saying there are no attributes at this node. 

list -m

server.applications.app1.ejb-module1_jar.bean1

Note: In standalone modules, the node containing the application name (app1 in this example) will not appear.

List of child nodes: 

bean-poolbean-cachebean-method

list -m

server.applications.app1.ejb-module1_jar.bean1

Note: In standalone modules, the node containing the application name (app1 in this example) will not appear.

Hierarchy of child nodes and a list of all attributes for this node and for any subsequent child nodes. 

get -m

server.applications.app1.ejb-module1_jar.bean1.*

Note: In standalone modules, the node containing the application name (app1 in this example) does not appear.

The following attributes and their associated values: 


CreateCount_CountCreateCount_
DescriptionCreateCount_
LastSampleTimeCreateCount_
NameCreateCount_
StartTimeCreateCount_
UnitMethodReadyCount_
CurrentMethodReadyCount_
DescriptionMethodReadyCount_
HighWaterMarkMethodReadyCount_
LastSampleTimeMethodReadyCount_
LowWaterMarkMethodReadyCount_
NameMethodReadyCount_
StartTimeMethodReadyCount_
UnitRemoveCount_CountRemoveCount_
DescriptionRemoveCount_
LastSampleTimeRemoveCount_
NameRemoveCount_StartTimeAttribute 
RemoveCount_Unit

list -m

server.applications.app1.ejb-module1_jar.bean1.bean-pool

Note: In standalone modules, the node containing the application name (app1 in this example) will not appear.

No attributes, but a message saying: Nothing to list at server.applications.appl.ejb-module1_jar.bean1-cache. To get the valid names beginning with a string, use the wildcard (*) character. For example, to list all names that begin with server, use list server*.

get -m

server.applications.app1.ejb-module1_jar.bean1.bean-pool.*

Note: In standalone modules, the node containing the application name (app1 in this example) will not appear.

List of attributes and values corresponding to EJB Pool attributes as described in Table 18–3.

list -m

server.applications.app1.ejb-module1_jar.bean1.bean-cache

Note: In standalone modules, the node containing the application name (app1 in this example) will not appear.

No attributes, but a message saying “Use get command with the --monitor option to view this node’s attributes and values.” 

get -m

server.applications.app1.ejb-module1_jar.bean1.bean-cache.*

Note: In standalone modules, the node containing the application name (app1 in this example) does not appear.

List of attributes and values corresponding to EJB Cache attributes as described in Table 18–4.

list -m

server.applications.app1.ejb-module1_jar.bean1.bean-method.method1

Note: In standalone modules, the node containing the application name (app1 in this example) will not appear.

No attributes, but a message saying “Use get command with the --monitor option to view this node’s attributes and values.” 

get -m

server.applications.app1.ejb-module1_jar.bean1.bean-method.method1.*

Note: In standalone modules, the node containing the application name (app1 in this example) will not appear.

List of attributes and values corresponding to EJB Methods attributes as described in Table 18–2.

list -m

server.applications.app1.web-module1_war

Displays the virtual server(s) assigned to the module. 

get -m

server.applications.app1.web-module1_war.*

No output except a message saying there are no attributes at this node. 

list -m

server.applications.app1.web-module1_war.virtual_server

Displays list of servlets registered. 

get -m

server.applications.app1.web-module1_war.virtual_server.*

No output except a message saying there are no attributes at this node. 

list -m

server.applications.app1.web-module1_war.virtual_server.servlet1

No attributes, but a message saying “Use get command with the --monitor option to view this node’s attributes and values.” 

get -m

server.applications.app1.web-module1_war.virtual_server.servlet1.*

List of attributes and values corresponding to web container (Servlet) attributes as described in Table 18–6.

The following table shows the command, dotted name, and corresponding output for the HTTP Service level.

Table 18–27 HTTP-Service Level

Command 

Dotted Name 

Output 

list -m

server.http-service

List of virtual servers. 

get -m

server.http-service.*

No output except message saying there are no attributes at this node. 

list -m

server.http-service.server

List of HTTP Listeners. 

get -m

server.http-service.server.*

No output except message saying there are no attributes at this node. 

list -m

server.http-service.server.http-listener1

No attributes, but a message saying “Use get command with the --monitor option to view this node’s attributes and values.” 

get -m

server.http-service.server.*

List of attributes and values corresponding to HTTP Service attributes as described in Table 18–8.

The following table shows the command, dotted name, and corresponding output for the thread pools level.

Table 18–28 Thread-Pools Level

Command 

Dotted Name 

Output 

list -m

server.thread-pools

List of thread-pool names. 

get -m

server.thread-pools.*

No output except message saying there are no attributes at this node. 

list -m

server.thread-pools.orb\.threadpool\.thread-pool-1

No attributes, but a message saying “Use get command with the --monitor option to view this node’s attributes and values.” 

get -m

server.thread-pools..orb\.threadpool\.thread-pool-1.*

List of attributes and values corresponding to Thread Pool attributes as described in Table 18–13.

The following table shows the command, dotted name, and corresponding output for the resources level.

Table 18–29 Resources Level

Command 

Dotted Name 

Output 

list -m

server.resources

List of pool names. 

get -m

server.resources.*

No output except message saying there are no attributes at this node. 

list -m

server.resources.jdbc-connection-pool-pool.connection-pool1

No attributes, but a message saying “Use get command with the --monitor option to view this node’s attributes and values.” 

get -m

server.resources.jdbc-connection-pool-pool.connection-pool1.*

List of attributes and values corresponding to Connection Pool attributes as described in Table 18–9.

The following table shows the command, dotted name, and corresponding output for the transaction service level.

Table 18–30 Transaction-Service Level

Command 

Dotted Name 

Output 

list -m

server.transaction-service

No attributes, but a message saying “Use get command with the --monitor option to view this node’s attributes and values.” 

get -m

server.transaction-service.*

List of attributes and values corresponding to Transaction Service attributes as described in Table 18–14.

The following table shows the command, dotted name, and corresponding output for the ORB level.

Table 18–31 ORB Level

Command 

Dotted Name 

Output 

list -m

server.orb

server-orb.connection-managers

get -m

server.orb.*

No output except message saying there are no attributes at this node. 

list -m

server.orb.connection-managers

Name(s) of ORB connection managers. 

get -m

server.orb.connection-managers.*

No output except message saying there are no attributes at this node. 

list -m

server.orb.connection-managers.orb\.Connections\.Inbound\.AcceptedConnections

No attributes, but a message saying “Use get command with the --monitor option to view this node’s attributes and values.” 

get -m

server.orb.connection-managers.orb\.Connections\.Inbound\.AcceptedConnections.*

List of attributes and values corresponding to ORB Connection Manager attributes as described in Table 18–12.

The following table shows the command, dotted name, and corresponding output for the JVM level.

Table 18–32 JVM Level

Command 

Dotted Name 

Output 

list -m

server.jvm

No attributes, but a message saying “Use get command with the --monitor option to view this node’s attributes and values.”

get -m

server.jvm.*

List of attributes and values corresponding to JVM attributes as described in Table 18–15.