Installing and running a Java agent on a remote host

You must install the resource monitoring java agent on the target host for which you want to monitor the resources and collect the metrics of HCL DevOps Test Hub (Test Hub). You need to run the agent to establish a connection with Test Hub.

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 Java agent must have been launched from a jar file and requires a Java 17 virtual machine.
  • Read and been familiar with the requirements to install and configure the resource monitoring agents on Test Hub. See Resource monitoring agents.

Procedure

  1. Click Set up Agents to extend Resource Monitoring service link in Test Hub to access the agents page where you can find the instructions and commands that you can use to install and run the agents. Link to instructions about how to extend RM service with agents
  2. Expand Configure the Java agent and click Download jar file to download the Java agent.
    You can also use the curl and 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 jar file name.

    With curl:

    curl -O -J https://hostName/rm/Agent-jar

    With wget:

    wget --content-disposition https://hostName/rm/Agent-jar
  3. Configure the command as follows to run your agent:
    1. Copy the appropriate command for Windows or Linux with the code snippets.
    2. Enter the path to the directory that contains the agent .jar file, and paste the command.
    To connect resource monitoring agents to Test Hub in a team space use the following commands:
    On Windows:
    set HCL_ONETEST_OFFLINE_TOKEN=(Enter your offline token here)
    java -jar (Enter the name of the downloaded jar file here) --ServiceUrl=https://hostName/rm --spaceId=<team-space_id>
    On Linux:
    sudo HCL_ONETEST_OFFLINE_TOKEN=(Enter your offline token here) java -jar (Enter the name of the downloaded jar file here) --ServiceUrl=portNumber/rm --spaceId=<team-space_id>
    To connect resource monitoring agents to Test Hub in a project use the following commands:
    On Windows:
    set HCL_ONETEST_OFFLINE_TOKEN=(Enter your offline token here)
    java -jar (Enter the name of the downloaded jar file here) --ServiceUrl=https://hostName/rm --projectId=<project_id>
    On Linux:
    sudo HCL_ONETEST_OFFLINE_TOKEN=(Enter your offline token here) java -jar (Enter the name of the downloaded jar file here) --ServiceUrl=portNumber/rm --projectId=<project_id>

Results

When the agent is started, the agent is connected to Test Hub. The agent is displayed in the list of connected resource monitoring agents with the hostname and status of the agent. The agent is also added to the main page of the resource monitoring service in Test Hub.view of total and type of sources, agents added to a project

What to do next

You can use another method to start an agent. See Starting a resource monitoring Java agent as a service on Windows or Starting a resource monitoring Java agent as a service on Linux. You can then add a new resource monitoring source. Resource monitoring metrics can be collected from a service or from the named agents, depending on the capabilities supported by the environment.