Oracle GlassFish Server 3.0.1 Administration Guide

ProcedureTo Enable Monitoring

Use the enable-monitoring subcommand to enable the monitoring service itself, or to enable monitoring for individual modules. Monitoring is immediately activated, without restarting GlassFish Server.

You can also use the set(1) subcommand to enable monitoring for a module. Using the set command is not a dynamic procedure, so you need to restart GlassFish Server for your changes to take effect.

  1. Determine which services and components are currently enabled for monitoring.

    asadmin> get server.monitoring-service.module-monitoring-levels.*

    This example output shows that the HTTP service is not enabled (OFF for monitoring), but other objects are enabled:

  2. Enable monitoring by using the enable-monitoring(1) subcommand.

    Server restart is not required.

Example 8–1 Enabling the Monitoring Service Dynamically

This example enables the monitoring service without affecting monitoring for individual modules.

asadmin> enable-monitoring
Command enable-monitoring executed successfully

Example 8–2 Enabling Monitoring for Modules Dynamically

This example enables monitoring for the ejb-container module.

asadmin> enable-monitoring --level ejb-container=HIGH
Command enable-monitoring executed successfully

Example 8–3 Enabling Monitoring for Modules by Using the set Subcommand

This example enables monitoring for the HTTP service by setting the monitoring level to HIGH (you must restart the server for changes to take effect).

asadmin> set server.monitoring-service.module-monitoring-levels.http-service=HIGH
Command set executed successfully

See Also

You can also view the full syntax and options of the subcommand by typing asadmin help enable-monitoring at the command line.