AWS Elastic Beanstalk is a service provided by Amazon Web Services (AWS) that gives you the option of deploying and auto-scaling applications and services. You can modify your deployment by supplying additional resources or packages using a predefined
.ebextensions directory zipped into your deployment package. For more information, see Amazon's AWS documentation.
You can prepare configurations where OneAgent is already part of your application deployment. In such cases, you won't have to manually install OneAgent or restart servers to enable service monitoring.
What you need
- OneAgent download link (Windows or Linux)
- Access to your AWS Console
Get the OneAgent download
For Windows, go to Deploy Dynatrace > Start installation > Windows and select Download OneAgent installer. For more information, see Install OneAgent on Windows.
For Linux, go to Deploy Dynatrace > Start installation > Linux and follow the instructions. For more information, see Install OneAgent on Linux.
Create a configuration to install OneAgent
Because the specifics of this type of installation depend heavily on user customizations, we can't provide a simple set of steps that will work in all scenarios. The following is only a brief overview of the entire process, with examples that will help you create your own deployment.
Customizing your installation
When creating the configuration file, you can customize your installation using all the supported OneAgent installation parameters.
In the examples below:
We use the
--set-app-log-content-access=trueparameter to enable OneAgent to access log files for the purpose of Log Monitoring. If you want to add more parameters, separate them with a space.Important
Starting with OneAgent version 1.185, we recommend
APP_LOG_CONTENT_ACCESS=1. If you're using an earlier version of OneAgent, however, you should use
Make sure the configuration files are properly formatted YAML files. Most importantly, don't use tabs for indentation. Only spaces are allowed.
It's best to split the extension configuration into two files, one for downloading the OneAgent installer and the other for invoking the installation and post-installation tasks. Note that the Elastic Beanstalk extension script file names are important—the Amazon interpreter executes them in alphabetical order.
Create the download configuration file and save it with the name
0dynatraceDownload.config. The configuration file needs to contain a
files section where you must define:
- Download path and target file name (for example,
- Proper user rights settings
- The OneAgent download URL you copied to your text editor
files: "/tmp/dynatraceinstall.sh": mode: "000755" owner: root group: root source: "https://abc12345.live.dynatrace.com/installer/agent/unix/default/latest?Api-Token=abcdefghijklmnopqrstu&arch=x86&flavor=default"
Create a file called
1dynatraceInstallAndPost.config to execute the OneAgent installer and perform other tasks such as service restart.
The following script checks for an existing OneAgent setup and, if no OneAgent is found, executes installation from the
/tmp directory, setting the
--set-app-log-content-access=true installation parameter to enable Log Monitoring. Then the
httpd service is restarted.
commands: install_dynatrace: cwd: /tmp command: "/bin/sh dynatraceinstall.sh --set-app-log-content-access=true" restart_httpd: command: "service httpd restart"
1dynatraceInstallAndPost.config files to the
.ebextensions directory and place it in the Beanstalk deployment package.
Create a configuration file for downloading the installer and save it as
0dynatraceDownload.config. The file needs to contain a
sources section where you must define:
- Download destination (for example, your desktop)
- Download URL
The following example script excerpt downloads the Dynatrace OneAgent installer to
C:\OneAgent\Dynatrace-OneAgent-Installer.exe. To use it, you would need to replace the environment URL and the API token in the example with your environment URL and API token.
files: "C:/OneAgent/Dynatrace-OneAgent-Installer.exe": source: "https://abcdefghij.live.dynatrace.com/api/v1/deployment/installer/agent/windows/default-unattended/latest?Api-Token=abcdefghijklmnopqrstu&arch=x86&flavor=default"
1dynatraceInstallAndPost.config configuration file must also contain the installation command for OneAgent in the
The following example script excerpt executes the installer from the administrator's desktop folder in quiet mode (no graphical user interface involved). The file passes the
--set-app-log-content-access=true installation parameter to enable Log Monitoring.
commands: install_oneagent: command: "C:/OneAgent/Dynatrace-OneAgent-Installer.exe --quiet --set-app-log-content-access=true"
You don't need to add extra commands following OneAgent installation. Amazon will restart IIS for you after you've successfully uploaded all your application files.
Go to to the directory with your deployment package source code and create the
.ebextensions file, if it doesn't exit already. Copy the
1dynatraceInstallAndPost.config files to the
.ebextensions directory and place them in the Beanstalk deployment package.
Extend your configuration
For convenience, you can also include steps to download OneAgent in your configuration.
This Linux script example includes OneAgent download in the configuration. While this is necessary for the first installation of OneAgent, it might substantially lengthen future application updates because you download OneAgent each time. To improve your Beanstalk configuration, add a check for an existing OneAgent installation and have your scripts download OneAgent only when it isn't found on the system.
Inspect the following Linux configuration example carefully before creating your own scripts. The Amazon interpreter is sensitive to syntax errors. Take care in formatting and escaping special characters.
files: "/tmp/dynatraceElasticBeanstalk.sh": mode: "000755" owner: root group: root content: | #!/bin/bash if [ ! -d /opt/dynatrace/oneagent ]; then wget -O /tmp/Dynatrace-OneAgent.sh "https://yyyyyyyy.live.dynatrace.com/api/v1/deployment/installer/agent/unix/default/latest?Api-Token=xxxxxxxxxxGw&arch=x86" chmod 755 /tmp/Dynatrace-OneAgent.sh sudo chown root:root /tmp/Dynatrace-OneAgent.sh sudo /tmp/Dynatrace-OneAgent.sh commands: install_dynatrace: command: /tmp/dynatraceinstall.sh --set-app-log-content-access=true restart_nginx: command: service nginx restart ignoreErrors: true