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.conf
file:supervisord
should be configured to run withuser=root
andjmxfetch
withuser=jvm_user
. See lines 20 and 58 of the attached file below. - Add
jvm_user
to thedd-agent
group (on Debian distros:sudo usermod -G dd-agent jvm_user
, on RHEL:sudo gpasswd -a jvm_user dd-agent
) - Grant the
dd-agent
group write access to the JMXFetch log file and the agent'srun
directory (/opt/datadog-agent/run/
):sudo chmod -R g+w /var/log/datadog/jmxfetch.log /opt/datadog-agent/run/
- Restart the Agent:
sudo /etc/init.d/datadog-agent restart
NB: The permissions on the /var/log/datadog/jmxfetch.log
log file are currently not guaranteed to persist when the log file is rotated.
Please double check the permissions on this file if no entries get written to it while JMXFetch is running.
if anyone else finds this and struggle, I also had to change the
systemd
config for the service to run as root:And then use this as the config: