To allow multiple JVMs to share a single Java Agent installation, you must configure a separate probe for each JVM as described below. This ensures a unique name and port for each probe.
Optionally each probe can have its own points file and mediator assignment.
To configure a single Java Agent installation to be shared by multiple JVMs:
1. Determine how the JRE will be instrumented for all the Java applications that you plan to monitor. See"Preparing Application Servers for Monitoring with the Java Agent" on page 37.
Multiple JREs may exist. Each can have their own instrumentation method.
2. Specify the range of ports from which the probe can automatically select. The Java Agent communicates using the Java Agent listening port. A separate port is assigned for
communications for each JVM that a probe is monitoring. By default, the port number range (Min/Max) is set to 35000–35100. You must increase the port number range when the probe is working with more than 100 JVMs.
If a firewall separates the probe from the other Diagnostics components, configure the firewall to allow communications using the ports in the range you specify. For more information, see the chapter “Configuring Diagnostics to Work in a Firewall Environment" in the HP Diagnostics Server Installation and Administration Guide.
If you configure the firewall to allow probe communications on a range of ports that is different than the default, update the port range values as follows.
a. Locate the webserver.properties file in the folder <agent_install_directory>/etc.
b. Set the following properties to adjust the range of ports available for probe communications.
The minimum port in the port number range uses the following property:
jetty.port=35000
The maximum port in the port number range uses the following property:
jetty.max.port.offset=100
3. Assign a unique probe name using one of the following methods.
By default, the probe id is set to the value specified during the Java Agent Setup. This is set in probe.properties as the id property. The probe id needs to be unique for each probe on the same host instead of sharing the id set in probe.properties.
The command line properties must be entered on one line, without any line breaks. The probe ids defined on the Java command line override the probe names defined in the
probe.properties file using the probe’s id property.
a. Assign a probe Id to the probe for each JVM, using the Java command line or by editing the application startup script.
-Dprobe.id=<Unique_Probe_Name>
The following example shows a WebLogic startup script before reconfigured to run with Diagnostics:
"%JAVA_HOME%\bin\java" -hotspot -ms64m -mx64m -classpath "%CLASSPATH%"
Dweblogic.Domain=petstore Dweblogic.Name=petstoreServer -Dbea.home="C:\\bea"
-Dweblogic.management.password=%WLS_PW%
-Dweblogic.ProductionModeEnabled=%STARTMODE%
-Dcloudscape.system.home=./samples/eval/cloudscape/data
-Djava.security.policy=="C:\bea\wlserver6.1/lib/weblogic.policy"
weblogic.Server
The following example shows a WebLogic startup script after adding the probe.id parameter:
"%JAVA_HOME%\bin\java" -hotspot -ms64m -mx64m"
-Xbootclasspath/p:C:\MercuryDiagnostics\JAVAProbe\classes\Sun\1.6.0_
24\instr.jre;C:\MercuryDiagnostics\JAVAProbe\classes\boot"
-classpath "%CLASSPATH%"
-Dprobe.id=<Unique_Probe_Name> -Dweblogic.Domain=petstore -Dweblogic.Name=petstoreServer
-Dbea.home="C:\\bea" -Dweblogic.management.password=%WLS_PW%
-Dweblogic.ProductionModeEnabled=%STARTMODE%
-Dcloudscape.system.home=./samples/eval/cloudscape/data
-Djava.security.policy=="C:\bea\wlserver6.1/lib/weblogic.policy"
weblogic.Server
b. When a single Java parameter is specified but multiple probes are started using the same script, use the %0 string to generate a custom probe identifier for each probe—for example, in a clustered environment where a single startup script is used to start multiple probed application server instances.
On Linux:
-Dprobe.id=<probeName>%0
On Windows:
-Dprobe.id=<probeName>%%0
Use the first % to escape the second %.
The %0 is replaced dynamically with a number to create a unique probe name for each probe; for example, <probeName>0, <probeName>1, and so on.
4. (Optional) Specify the points file each probe will use. By default, the points file name is auto_
detect.points. You can specify that a custom points file be used when you must use more than one custom instrumentation plan, or where you have several JRE versions on the same machine using a single agent installation, and one or more of the JREs needs specific methods and classes included in a layer to support custom instrumentation.
-Dprobe.points.file.name="<Custom_AutoDetect_Points_File>"
where <Custom_AutoDetect_Points_File> is the name of your custom points file such as MyProbe1_private.points.
5. (Optional). Specify the mediator to which each probe will send its collected data. You can designate a specific mediator or enable auto-assignment to mediators. By default, the mediator that was specified at installation time is used. You can override that setting for any probe.
n To designate a specific mediator assignment for the probe, add the following to the application server startup script or command line:
-Ddispatcher.registrar.url=http://<mediator_host>:2006/registrar/
where <mediator_host> is the host name or IP of the mediator server host to which the probe sends its metrics.
n To designate that a mediator be automatically assigned to the probe, perform the following:
i. Enable auto-registration on each mediator server that you want to make available to the probe as an assignment option. Set the probe.mediator.capacity property in server.properties. For example:
probe.commander.capacity = 0 probe.mediator.capacity = 20
In this case, the mediator is used for up to 20 probe assignments.
When probe.commander.capacity is set to zero, the server will not participate in auto-assignment. That is, the Commander Server will not get auto-assigned to act as a mediator. This is recommended in a multi-server environment--only use the mediators to process incoming agent data.
ii. On the agent host, set the following properties in etc/dispatcher.properties to allow the commander to auto-assign mediators to the probes:
commander.registrar.url = http://<commander_host>:2006/registrar/
...
always.use.commander.registrar.url = true
The commander.registrar.url property specifies the Commander Server in the deployment. This is the Commander Server to which the mediators available for auto-assignment report.
The always.use.commander.registrar.url property set to "true" enables auto-registration for this probe. Note that when auto-auto-registration is enabled, the registrar.url setting in dispatcher.properties is ignored.
For details, see the comments for these properties in the etc/dispatcher.properties file.