Docker
This section describes how to run SmartAgent as a Docker container to achieve full-stack injection.
If you are using Docker runtime only, without any orchestration platforms (such as Kubernetes/Swarm), use this method.
warning
Supported on Linux only
Limitations
- SmartAgent can only access disks mounted inside the container, therefore it can only collect metrics from those accessible disks.
- The system preload configuration file
ld.so.preloadwill not be modified during installation, hence processes running on the host machine (non-container processes) are not supported. - Auto-update is not supported.
Installation
-
Log in to the
Bonree ONEplatform and go to Configuration > Agent Installation > SmartAgent > Docker. -
Copy the command and replace the parameters accordingly:
Type Parameter Description Environment Variable SMARTAGENT_INSTALLER_SCRIPT_URLThe URL copied with wgetfrom the Web agent download page.Environment Variable SMARTAGENT_INSTALL_PATHInstallation path (must be an absolute path, not the root directory). Environment Variable SMARTAGENT_INSTALLER_DOWNLOAD_TOKENAuthentication token required for downloading with SMARTAGENT_INSTALLER_SCRIPT_URL.Install Parameter <INSTALLER_PARAMETERS>All SmartAgent installation parameters are supported except for --target. See Installation Parameters.Example command:
docker run -d \
--name smartagent \
--restart=unless-stopped \
--privileged=true \
--pid=host \
--net=host \
-v /:/mnt/root \
-e SMARTAGENT_INSTALLER_SCRIPT_URL=<REPLACE_WITH_YOUR_URL> \
-e SMARTAGENT_INSTALL_PATH=/opt \
-e SMARTAGENT_INSTALLER_DOWNLOAD_TOKEN='<TOKEN>' \
docker.bonree.com/agent/smartagent:1.0 \
config <INSTALLER_PARAMETERS> -
Restart the business containers you want to monitor.
Start/Stop and Update
When the container starts, SmartAgent will automatically download the latest version from the specified URL, install, and run it.
docker restart smartagent