Cette page n'est pas encore disponible en français, sa traduction est en cours. Si vous avez des questions ou des retours sur notre projet de traduction actuel, n'hésitez pas à nous contacter.
To verify you have access to JMX, test using JConsole or equivalent if possible. If you’re unable to connect using JConsole this article may help to get you sorted. Also, if the metrics listed in your YAML aren’t 1:1 with those listed in JConsole you’ll need to correct this.
For all versions of Agent v5.32.8 or greater, the jmxterm JAR is not shipped with the agent. To download and use jmxterm, see the upstream project. Change /opt/datadog-agent/agent/checks/libs/jmxterm-1.0-DATADOG-uber.jar in the examples below to the jmxterm JAR path you downloaded from the upstream project.
If you’re able to connect using JConsole, run the following:
If you’re able to connect using the command above, run: beans and send to the Datadog support team a copy of the results from above along with the following information:
Note: If you’re able to see some metrics (jvm.heap_memory, jvm.non_heap_memory, etc.) it is a sign that JMXFetch is properly running. If you’re targeting another application and not seeing related metrics, the likely issue is a misconfiguration in your YAML.
List attributes that match at least one of your instances configuration.
sudo -u dd-agent datadog-agent jmx list limited
List attributes that do match one of your instances configuration but that are not being collected because it would exceed the number of metrics that can be collected.
sudo -u dd-agent datadog-agent jmx list collected
List attributes that are actually collected by your current instances configuration.
sudo -u dd-agent datadog-agent jmx list not-matching
List attributes that don’t match any of your instances configuration.
sudo -u dd-agent datadog-agent jmx list everything
List every attributes available that has a type supported by JMXFetch.
sudo -u dd-agent datadog-agent jmx collect
Start the collection of metrics based on your current configuration and display them in the console.
Notes:
By default these commands run on all the configured JMX checks. To limit the commands to specific checks, use the --checks flag, for example:
sudo -u dd-agent datadog-agent jmx list collected --checks tomcat
For Agent v6.26.+ / v7.26+, appending --flare writes the output of the above commands under /var/log/datadog/jmxinfo/, which is included in the flare.
sudo -u dd-agent datadog-agent jmx list everything -l debug --flare
The Agent 6 ships JMXFetch and supports all of its features, except those listed below.
The Agent doesn’t have a full featured interface to JMXFetch, so you may have to run some commands manually to debug the list of beans collected, JVMs, etc. A typical manual call will take the following form:
The location to the JRE tools.jar (/usr/lib/jvm/java-8-oracle/lib/tools.jar in the example) might reside elsewhere in your system. You should be able to find it with sudo find / -type f -name 'tools.jar'.
You may wish to specify alternative JVM heap parameters -Xmx, -Xms, the values used in the example correspond to the JMXFetch defaults.
List attributes that do match one of your instance configurations but that are not being collected because it would exceed the number of metrics that can be collected.
Datadog accepts a maximum of 350 metrics.
A best practice is to limit your metrics to less than 350 by creating filters to refine those metrics collected; but if you need more than 350 metrics, it is possible to increase this limit by modifying a parameter in your JMX config file.
The default Agent installation does not come with a bundled JVM and uses the one installed on your system. Therefore you must make sure that the Java home directory is present in the path of the user running the Agent.
Notes:
The gcr.io/datadoghq/agent:latest-jmx Docker image does include a JVM, which the Agent needs to run jmxfetch. Alternatively, you can specify the JVM path in the integration’s configuration file with the java_bin_path parameter.
Only one valid Java path needs to be specified for JMXFetch.
JBoss/WildFly applications expose JMX over a specific protocol (Remoting JMX) that is not bundled by default with JMXFetch. To allow JMXFetch to connect to these applications, configure it as follows:
Locate the jboss-cli-client.jar file on your JBoss/WildFly server (by default, its path should be $JBOSS_HOME/bin/client/jboss-cli-client.jar).
If JMXFetch is running on a different host than the JBoss/WildFly application, copy jboss-cli-client.jar to a location on the host JMXFetch is running on.
Add the path of the jar to the init_config section of your configuration:
Specify a custom URL that JMXFetch connects to, in the instances section of your configuration:
# Datadog Agent >= 5.6.0# The jmx_url may be different depending on the version of JBoss/WildFly you're using# and the way you've set up JMX on your server# Refer to the relevant documentation of JBoss/WildFly for more informationinstances:- jmx_url:"service:jmx:remote://localhost:4447"name:jboss-application # Mandatory, but can be set to any value,# is used to tag the metrics pulled from that instance
Note: If you run into warning message like Unable to instantiate or initialize instance <instance_name> for an unknown reason.Parameter 'name' may not be null, you may need to set a wildfly user with $WILDFLY_HOME/bin/add-user.sh -a -u <user> -p <password> and specify user and password in the instances section of your configuration:
If you’re using Tomcat with JMX remote lifecycle listener enabled (see the Tomcat documentation for more information), JMXFetch needs an additional setup to be able to connect to your Tomcat application.
Locate the catalina-jmx-remote.jar file on your Tomcat server (by default, its path should be $CATALINA_HOME/lib).
If JMXFetch is running on a different host than the Tomcat application, copy catalina-jmx-remote.jar to a location on the host JMXFetch is running on.
Add the path of the jar to the init_config section of your configuration:
Specify a custom URL that JMXFetch connects to, in the instances section of your configuration:
# Datadog Agent >= 5.6.0# The jmx_url may be different depending on the way you've set up JMX on your Tomcat serverinstances:- jmx_url:"service:jmx:rmi://:10002/jndi/rmi://:10001/jmxrmi"name:tomcat-application # Mandatory, but can be set to any arbitrary value,# is used to tag the metrics pulled from that instance
Once JMX is enabled and your Agent check is successfully sending metrics to Datadog, you can secure the remote connection over an SSL Socket.
Note: You cannot secure JMX over SSL without using the JMX remote user/password authentication files. If you are using system level permissions to run your application, add these files and run them at startup.
This example shows the Datadog configuration for the Tomcat integration.