Plugin for GlassFish Monitoring

Monitor GlassFish servers using Site24x7 and stay on top of issues.

GlassFish is an open source application server project sponsored by Oracle corporation. Configure Site24x7 plugin to monitor the performance of your GlassFish servers.

This document details how to configure the Oracle GlassFish plugin and the monitoring metrics for providing in-depth visibility into the performance, availability, and usage stats of GlassFish servers.

GlassFish performance monitoring metrics:

Troubleshoot your GlassFish environment with ease by keeping track of critical metrics including:

Committed heap/non-heap memory

The metrics 'usedheapsize-count' and 'usednonheapsize-count' gives us the total amount of used heap/non-heap memory in bytes.

Maximum heap/non-heap memory

The metrics 'maxheapsize-count' and 'maxnonheapsize-count' gives us the maximum amount of heap/non-heap memory in bytes that can be used for memory management.

Initial heap/non-heap memory

The metrics 'initheapsize-count' and 'initnonheapsizecount' gives us the total amount of heap/non-heap memory in bytes that the JVM initially requests from OS for memory management.

Committed heap/non-heap memory

The metrics 'committedheapsize-count' and 'committednonheapsize-count' gives us the total amount of heap/non-heap memory in bytes that is committed for the JVM to use.

Object pending finalization

The metric 'objectpendingfinalization-count' gives us the approximate amount of objects for which finalization is pending.

Deadlocked threads

Get information on the number of threads in deadlock waiting to acquire object monitors or ownable synchronizers using the metric 'deadlockedthreads'.

Threads started

Get information on the number of threads created and also started since the JVM started using the metric 'totalstartedthreadcount'.

Daemon threads

Get information on the number of live daemon threads using the metric 'daemonthreadcount'.

Monitor deadlocked threads

Get information on the number of threads in deadlock waiting to acquire object monitors using the metric 'monitordeadlockedthreads'.

Current thread user time

Get information on the CPU time for a thread executed in user mode using the metric 'currentthreadusertime'.

Peak thread count

Get information on the peak live thread count since the JVM started or peak was reset using the metric 'peakthreadcount'.

Thread count

Get information on the number of live threads including daemon and non-daemon threads using the metric 'threadcount'.

Current thread CPU time

Get information on the total CPU time for the current thread in nanoseconds using the metric 'currentthreadcputime'.

Connection leaks

Use the metric 'numpotentialconnleak' and get the number of potential connection leaks possible.

Logical connection released

Use the metric 'numconnreleased' and get the number of possible logical connections released to the pool.

Queued connection requests

Use the metric 'waitqueuelength' and get the number of connection requests in the queue waiting to be serviced.

Free connections

Use the metric 'numconnfree' and get the number of free connections in the pool.

Connection wait-time

Use the metric 'averageconnwaittime' and get the average wait-time duration per successful connection request.

Connections timed out

Use the metric 'numconntimedout' and get the number of connections in the pool that timed out from start time.

Connections created

Use the metric 'numconncreated' and get the total number of physical connections that were created since the last reset.

How it works?

  • Log-in to your Site24x7 account. Sign up here if you don't have one
  • Download and install the latest version of Site24x7 Linux agent
  • Install the GlassFish plugin
  • The agent will execute the GlassFish plugin and push the data to the Site24x7 server

Prerequisites:

  • Ensure GlassFish is installed in the server and it is up and running.

GlassFish plugin installation:

  • Create seperate directories for all the three plugins with the name "glassfish_jvm_memory", "glassfish_jvm_thread", "glassfish_resource_connectionpool" under the Site24x7 Linux agent's plugin directory - /opt/site24x7/monagent/plugins/
    cd /opt/site24x7/monagent/plugins/
    sudo mkdir glassfish_jvm_memory
    sudo mkdir glassfish_jvm_thread
    sudo mkdir glassfish_resource_connectionpool
  • Download the file ""glassfish_jvm_memory.py" from our GitHub repository and place it under the "glassfish_jvm_memory" directory
    cd glassfish_jvm_memory
    sudo wget https://raw.githubusercontent.com/site24x7/plugins/master/glassfish_jvm_memory/glassfish_jvm_memory.py
  • Download the file "glassfish_jvm_thread.py" from our GitHub repository and place it under the "glassfish_jvm_thread" directory
    cd glassfish_jvm_thread
    sudo wget https://raw.githubusercontent.com/site24x7/plugins/master/glassfish_jvm_thread/glassfish_jvm_thread.py
  • Download the file "glassfish_resource_connectionpool.py" from our GitHub repository and place it under the "glassfish_resource_connectionpool" directory
    cd glassfish_resource_connectionpool
    sudo wget https://raw.githubusercontent.com/site24x7/plugins/master/glassfish_resource_connectionpool/glassfish_resource_connectionpool.py

Steps to enable monitoring in GlassFish server

  • The following steps need to be peformed to enable monitoring for your GlassFish server:
    cd /bin/asadmin
    ./asadmin
    set server.monitoring-service.module-monitoring-levels.jvm=LOW
    set server.monitoring-service.module-monitoring-levels.jdbc-connection-pool=LOW

GlassFish plugin configuration:

  • The default python path given in the plugin script is #!/usr/bin/python. If you wish to provide an alternate python path, replace the existing one preceded by the shebang character "#!".
  • Configure host and port values for the GlassFish plugin
    HOST = "localhost"
    ADMINPORT = "4848"
    USERNAME = None
    PASSWORD = None
  • The same edits can be done for connection pool and thread plugins as well.
  • Save the changes and restart the agent.
    /etc/init.d/site24x7monagent restart

Monitoring additional metrics:

  • To monitor additional metrics, edit any one of the plugin files and add the new metrics that need monitoring
  • Increment the plugin version value in the plugin file to view the newly added metrics ( For e.g. Change the default plugin version from PLUGIN_VERSION = "1" to "PLUGIN_VERSION = "2")

Related plugins:

  • Redis plugin - Monitor performance metrics of your Redis databases
  • MongoDB plugin - Monitor performance metrics of your MongoDB databases
  • Memcached plugin - Analyze performance of your Memcached server
  • Nagios plugin - Execute thousands of Nagios plugins in Site24x7 without the need of running a Nagios server
  • Out-of-the-box plugins - Monitor your entire app stack with our extensive list of integrations
  • Create custom plugins - Create custom Linux and Windows plugins and monitor custom attributes