These instructions are known to work with version 5.10.1 of the packaged linux Datadog Agent
Using the AttachAPI can require running JMXFetch as the same user as the JVM you want to monitor.
To run JMXFetch as the jmv_user user (once you've identified which user your JVM is running as), please follow these steps:
- Make 2 changes on the
/etc/dd-agent/supervisor.conffile:supervisordshould be configured to run withuser=rootandjmxfetchwithuser=jvm_user. See lines 20 and 58 of the attached file below. - Add
jvm_userto thedd-agentgroup (on Debian distros:sudo usermod -G dd-agent jvm_user, on RHEL:sudo gpasswd -a jvm_user dd-agent) - Grant the
dd-agentgroup write access to the JMXFetch log file and the agent'srundirectory (/opt/datadog-agent/run/):sudo chmod -R g+w /var/log/datadog/jmxfetch.log /opt/datadog-agent/run/