Skip to content

Deploying Onagre Agent with Docker

Overview

The Onagre Agent can be deployed as a Docker container, allowing for easy installation and management. This method is particularly useful for deploying the agent on Linux environments while ensuring seamless monitoring of both public and private infrastructure.

Platform Compatibility

The Onagre Agent for Docker is currently only compatible with Linux-x64 architectures.

Pulling the Docker Image

To retrieve the latest version of the Onagre Agent, run the following command:

docker pull onagreio/agent

Running the Onagre Agent Container

To deploy the Onagre Agent using Docker, follow these steps:

  1. Ensure you have a valid Onagre Agent Token.
  2. Create a configuration directory on your system to store the agent's configuration files.
  3. Ensure the configuration directory has sufficient write permissions for the container to store necessary files.
  4. Run the agent using Docker, passing the necessary environment variables and volume mounts.

Example Deployment Command

docker run -d \
    --ulimit nofile=65536:65536 \
    --network host \
    -e "TOKEN=YOUR_TOKEN" \
    -v $(pwd)/onagre_conf:/etc/onagre \
    --name onagre-agent \
    --restart=always \
    onagreio/agent

Explanation of Parameters

Parameter Description
--ulimit nofile=65536:65536 Increases the file descriptor limit for better performance.
--network host Runs the container in host networking mode for direct access to monitored services.
-e "TOKEN=YOUR_TOKEN" Passes the required Onagre Agent token as an environment variable.
-v $(pwd)/onagre_conf:/etc/onagre Mounts a local directory as the configuration folder for the agent. Ensure this directory has write permissions for the container.
--name onagre-agent Assigns a recognizable name to the container.
--restart=always Ensures the agent restarts automatically if the container stops.

Managing the Agent

Checking Logs

To monitor the logs of the running Onagre Agent, use:

docker logs -f onagre-agent

Restarting the Agent

To restart the agent container manually, run:

docker restart onagre-agent

Stopping and Removing the Agent

To stop and remove the agent container:

docker stop onagre-agent && docker rm onagre-agent

Summary

Deploying the Onagre Agent via Docker provides a straightforward and flexible way to integrate monitoring capabilities into your infrastructure. By leveraging containerization, the agent remains easy to manage, scalable, and secure.