cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dynatrace agent on WSL2

Stanley
Frequent Guest

I am running the latest version of Ubuntu on WSL2 on Windows. I have a local copy of my client's wordpress website and mysql database, with near identical nginx webserver and php.

I need to install OneAgent in order to unlock mySQL insights, nginx insights, wordpress page insights and so forth

There is much potential as Dynatrace outlines in https://www.dynatrace.com/technologies/php-monitoring/wordpress

When I install it on WSL Ubuntu, I get this error,

root@localhostname# cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.5 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.5 LTS"
VERSION_ID="20.04"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
root@localhostname# /bin/sh Dynatrace-OneAgent-Linux-1.253.245.sh --set-infra-only=false --set-app-log-content-access=true
01:57:47 Checking root privileges...
01:57:47 Process user: root, ID: 0
01:57:47 OK
01:57:47 Logging to /var/log/dynatrace/oneagent/installer/installation_4818.log
01:57:47 Installation started, version 1.253.245.20221118-071521, build date: 18.11.2022, PID 4818.
01:57:47 Detected platform: LINUX arch: X86_64
01:57:47 Error: Dynatrace OneAgent cannot be installed inside a container (or in an isolated mount namespace), setup won't continue.
01:57:47 Error: For a supported way of deployment using a container please refer to: https://www.dynatrace.com/support/help/shortlink/oneagent-docker


Following the link above, one of the steps is to run apparmor, but when I do, I get this error

root@localhostname# apparmor_parser -r /etc/apparmor.d/oneagent Cache read/write disabled: interface file missing. (Kernel needs AppArmor 2.4 compatibility patch.) Warning: unable to find a suitable fs in /proc/mounts, is it mounted? Use --subdomainfs to override.


I need guidance here, this may be the first post on installing on wsl2 ubuntu. How can I get past this error or is there another way I get agent installed to grab full insights (mysql, wordpress, php, nginx)?

1 REPLY 1

Julius_Loman
DynaMight Legend
DynaMight Legend

As it says - it's not supported to install it this way in a container - WSL2 is considered a container here.

What you can do - you can use the PaaS agent version. In this case, you must wrap execution of your application.
So basically you need to:

  1. download the PaaS agent version instead:
    wget -O Dynatrace-OneAgent-Linux.zip "https://<dt_environment>/api/v1/deployment/installer/agent/unix/paas/latest?arch=x86&flavor=default" --header="Authorization: Api-Token <dt_paas_token>"​
  2. unzip the agent to a directory such as /opt/dynatrace/oneagent or any of your choice.
  3. run each process to be monitored using the dynatrace-agent32.sh or dynatrace-agent64.sh depending on the platform

PaaS agents will have some limitations of course but should work in your case.

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

Featured Posts