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. You need to run the 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 Java agent must have been launched from a jar file and requires a Java 8 virtual machine.

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 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.

    For Windows:

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

    For Linux:

    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.
    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 HCL OneTest Server. 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 HCL OneTest Server.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.