GlassFish Monitoring for Top Application Performance

How to Monitor the Oracle GlassFish Enterprise Server Using eG Enterprise

eG Enterprise monitors the GlassFish server in both agent-based or agentless manners. All that is required for this is a single eG agent on any remote Windows host in the environment. To enable the eG agent to pullout metrics on the performance of the GlassFish server, a set of pre-requisites should be fulfilled. These requirements have been discussed in the section below.

Pre-requisites for Monitoring Oracle GlassFish Enterprise Server

To enable the eG agent to collect metrics on health of key components of the application server such as the servlets, EJBs, connection pools, caches, the JVM, and more!, you need to make sure that the following pre-requisites are fulfilled:

  1. The eG agent should be configured to use JMX to connect to the JRE of the GlassFish server and collect the metrics of interest. By default, JMX support is enabled for GlassFish. If, for some reason, jmx is disabled for the GlassFish server in your environment, then, follow the steps below to enable it:

    • In an editor, open the domain.xml file in the <glassfish_install_dir>\Sun\AppServer\domains\domain1\config directory and look for the code block shown below:

      <jmx-connector accept-all="false" address="0.0.0.0" auth-realm-name="admin-realm" enabled="false" name="system" port="8686" protocol="rmi_jrmp" security-enabled="false">

    • If JMX is disabled for the GlassFish server, then the enabled parameter in the code block above will be set to false. To enable JMX, set the enabled parameter to true as shown below:

      <jmx-connector accept-all="false" address="0.0.0.0" auth-realm-name="admin-realm" enabled="true" name="system" port="8686" protocol="rmi_jrmp" security-enabled="false">

    • Against the port parameter, configure the port at which JMX listens. The default JMX port is 8686.
    • Finally, save the file.
  2. Since JMX on GlassFish requires authentication by default, every test executed by the eG agent should be configured with the credentials of an Administrator to the GlassFish server. If you prefer not to expose the administrator credentials owing to security compulsions, then configure the test with the credentials of any valid user who has the right to use JMX. To know the name of such a user, do the following:

    • In an editor, open the domain.xml file in the <glassfish_install_dir>\Sun\AppServer\domains\domain1\config directory and look for the code block shown below:

      <jmx-connector accept-all="false" address="0.0.0.0" auth-realm-name="admin-realm" enabled="true" name="system" port="8686" protocol="rmi_jrmp" security-enabled="false">

    • The user name specified against the auth-realm-name parameter in the code block above can be configured as the user, and the password of that user can be specified against JMX PASSWORD.
  3. You should enable the Monitoring service of the GlassFish server. To achieve this, do the following:

    • Connect to the GlassFish server using the URL: http://<GlassFishServer_IP>:<GlassFishServer_Port>/
    • Login to the server as administrator.
    • Figure 1 will then appear. Expand the Configuration node in the tree-structure in the left panel of Figure 1, and select the Monitoring sub-node within.

      GlassFish Monitoring

      Figure 1 : Enabling the Monitoring Service

    • Set the monitoring-level for all the server components listed in the right panel to high.
    • Finally, click the Save button in the right-panel to save the changes.

    Once the above-said pre-requsites are fulfilled, start monitoring the GlassFish server using the eG Enterprise. The broad steps for monitoring the server using eG Enterprise are as follows: