Installing and running a Docker agent on a remote host

You must install the resource monitoring Docker agents on the target host for which you want to monitor the resources and collect the metrics. You need to run an agent to establish a connection with HCL OneTest Server.

Before you begin

  • The resource monitoring service does not require access to the agent host but the agent must have reached the service host over HTTPS.
  • The Docker agent must have been launched in a Docker container and requires Docker 19.03.

Procedure

  1. Click Set up Agents to extend Resource Monitoring service link in HCL OneTest Server to access the agents page where you can find the instructions and commands that are to be used to install and run the agents. Link to instructions about how to extend RM service with agentsinstructions about how to configure a Docker agent
  2. Expand Configure the Docker agent and click Download Dockerfile to download a Docker agent.
    You can also use the curl or wget commands to download the agent without accessing the resource monitoring web UI.

    For more facility, use the code snippets to copy and fill in the commands with the valid offline token and the Docker file name.

    For Windows:

    curl -O -J https://hostName/rm/agent-Dockerfile

    For Linux:

    wget --content-disposition hostName/rm/agent-Dockerfile
  3. Copy the build command that is under Build the Docker image, paste it in your console and run it to build a resource monitoring Docker image.
    Before you start the a Docker agent, you must build a Docker image.
    docker build --network=host --rm -t rmagent
  4. Follow these steps to run the agent:
    1. Click to fill in the appropriate command for Windows or Linux with the valid offline token.
    2. Click to copy the command to clipboard and paste the command in the console.
      • Command on Windows:
      docker run -it --rm --privileged -e PROJECT_ID=230200 -e HCL_ONETEST_OFFLINE_TOKEN=(Enter your offline token here) --network host -v //var/run/docker.sock:/var/run/docker.sock rmagent
      • Command on Linux:
      docker run -it --rm --privileged -e PROJECT_ID=230200 -e HCL_ONETEST_OFFLINE_TOKEN=(Enter your offline token here) --network host -v /var/run/docker.sock:/var/run/docker.sock -v /etc:/etc -v /proc:/proc rmagent
    3. Paste the command in the console and run the command.

    Resource monitoring agents

Results

When the agent is started, the agent is connected to HCL OneTest Server. The agent is displayed in the list of connected resource monitoring agents with the host name and status of the agent. The agent is also added to the main page of the resource monitoring service in HCL OneTest Server.

What to do next

You can add a new resource monitoring source. It can be collected from a service or from the named agents, depending on the capabilities supported by the environment.