This guide walks you through installing the Middleware Host Agent (MW Agent) on a machine deployed through Docker. These instructions can also be found on the Installation page in the Middleware application.
The Docker MW Agent is a containerized version of the MW Agent. Upon installation, the MW Agent collects host level details from host network mode and uses volume binding for reading logs.
Follow the steps below to install the MW Agent.
Log in to Middleware
Navigate to the installation page, in the bottom left corner
Copy and run the installation command. An example of the command is shown below. Copying the command directly from the Installation page ensures your API key and UID are accurately inputted.
MW_API_KEY=<xxxxxxxxxx> MW_TARGET=https://<uid>.middleware.io:443 bash -c "$(curl -L https://install.middleware.io/scripts/docker-install.sh)"
4.[optional] Add tags by adding the MW_HOST_TAGS environment variable to the installation command. Include any desired tags as comma-separated key-value pairs, as shown below. Use the tag “name” to create an alias for the host (e.g. production).
- Verify the status of the MW Agent with the following command.
docker ps -a --filter ancestor=ghcr.io/middleware-labs/mw-host-agent:master
A successful installation returns the status ‘Up’ or ‘Exited’. If the installation is unsuccessful the status will be blank.
- Navigate to Middleware and ensure metrics are appearing in the Unified Dashboard . It can take up to a few minutes for metrics to appear. If metrics do not appear after this time head to our troubleshooting page for some common issues.
Once the MW Agent is installed metrics should appear in the Middleware Application within a few minutes. If metrics do not appear, confirm that the machine has access to the internet, either directly or through a proxy, and that only one MW Agent per container is running.
For any issues please reach out to our team in your Slack channel or through the help menu in the Middleware Application.
To uninstall the Middleware Agent use the following commands:
docker stop `docker ps -a -q --filter ancestor=ghcr.io/middleware-labs/mw-host-agent:master` docker rm `docker ps -a -q --filter ancestor=ghcr.io/middleware-labs/mw-host-agent:master`