12 Jun 2025
12:12 PM
- last edited on
13 Jun 2025
07:38 AM
by
MaciejNeumann
Hi Dynatrace Community,
We’re currently working on automating the deployment of Dynatrace OneAgent on virtual machine images using a Chef cookbook. The intended flow involves a shell script that:
Executes a wget command to download the OneAgent installer to the target VM,
Runs the modified installer with predefined parameters (e.g., custom log directory, monitoring mode, etc.).
To support this, we’ve ensured the following environment preparations:
A persistent, mounted /opt/dynatrace directory with at least 5GB allocated,
Verified connectivity across our internal network to reach Dynatrace SaaS/Managed servers as required.
However, I’m facing a few questions and would appreciate guidance from the community:
1. Fixing or Dynamically Pulling Agent Versions
What is the best practice for downloading the installer via wget in a way that allows dynamically fetching the latest available version? since using wget command allows downloading and fetching only a fixed version of the agent.
2. Download Token Expiry
Does the OneAgent download token have an expiration date or lifecycle policy I should be aware of?
3. Token Rotation & Secure Usage
What is the recommended approach to securely rotate the download token and integrate it into a script used by the Chef cookbook? Any best practices for token management at scale would be greatly appreciated.
If anyone has successfully implemented a similar solution or has tips on robust agent deployment pipelines using configuration management tools, I’d love to hear about it.
Thanks in advance for your help and insights!
Roei
16 Jun 2025 09:43 AM
Hi @Roeir5
Wouldn't it be better for you to use an Ansible role to run the installations instead of writing your own shell script?
https://galaxy.ansible.com/ui/repo/published/dynatrace/oneagent/content/role/oneagent/
As for the token, you can define its validity within Dynatrace management.
Similarly, you can configure how often and to which version the OneAgent upgrade should be performed in the Settings → Updates → OneAgent updates section.