AppDynamics Knowledge Base

Configuring a Custom Directory for Smart Agent Installation on Linux to Avoid /tmp Space Errors

Configuring a Custom Directory for Smart Agent Installation on Linux to Avoid /tmp Space Errors

How to Redirect Smart Agent Temporary Files to Avoid /tmp Space Limitations on Linux

Installing any APM or Machine agent with Smart Agent on your Linux box will use /tmp directory to copy agent binaries before moving them to the intended directory.

The problem

You can get an error like below:

error message = Error extracting Machine Agent in staging: reading file in zip archive: /tmp/.staging/machine-agent/jre/lib/modules: writing file: write /tmp/.staging/machine-agent/jre/lib/modules: no space left on device
Error creating Machine Agent service: error installing service: error moving service file to destination: rename /tmp/.staging/appdynamics-machine-agent.service /etc/systemd/system/appdynamics-machine-agent.service: invalid cross-device link

These errors are caused due to less space in /tmp folder or /tmp directory mounted on an external device.

How to fix it

You need to have Smart Agent use any other directory on our host then tmp.

To do this:

  • Go to <Smart-Agent-Home-Directory>, In my case the directory is /opt/appdynamics/appdsmartagent
  • Commands in order:
    cd /opt/appdynamics/appdsmartagent
    ./smartagentctl stop
    export TMPDIR=/opt/appdynamics
    ./smartagentctl start

Now in your logs, you will see

{"severityText":"INFO","timestamp":"2024-10-04T16:30:29.692Z","name":"native","caller":"machine/task_helper.go:48","body":"downloaded file to ","downloaded file":"/opt/appdynamics/.staging/download/machineagent-bundle-64bit-linux-24.9.0.4408.zip"}
{"severityText":"INFO","timestamp":"2024-10-04T16:30:29.692Z","name":"native","caller":"machine/task_helper.go:161","body":"Extracting zip","package.name":"8a5e85401b3a01ac5dadd6394c235dbf032ffa04;MACHINE_AGENT","src path":"/opt/appdynamics/.staging/download/machineagent-bundle-64bit-linux-24.9.0.4408.zip","dest path":"/opt/appdynamics/.staging/machine-agent"}

This means, Smart Agent is now copying everything in /opt/appdynamics directory.

Version history
Last update:
‎11-22-2024 10:47 AM
Updated by: