Registering the Agent using the Agent Registration API


You can use the Agent Registration API to register the newly installed Agent or the Agent that runs within a Docker container. The registration process involves creating a new Agent list or updating an existing list by using the API. The list contains the names of managed systems where Agents are installed. After you register the Agent, the Gateway Server starts collecting data from the Agent.

For information about the API, see Agent-Registration-API.

Depending on the Agent installation type, you can use one of the following registration methods:

To register the Agent installed on a managed system

You can call the Agent Registration API using different methods. This section provides information about running the cURL commands for registering the Agent.

Prerequisites

Ensure that the cURL tool is installed on the system from where you want to run cURL commands.

Registration procedure

  1. Log in to the TrueSight Capacity Optimization console and do the following:
    1. Select Administration > Users > Roles.
    2. Generate and download an API key. For more information, see Generating-an-API-key-for-programmatic-access.
  2. In a text editor, open the downloaded key and copy the authorization token.
  3. In the following cURL command, paste the copied token and specify values for the parameters indicated:

    curl --insecure --request POST --data '{"agent.list.name":"<Agent list name>","agent.name":"<Agent name>","gateway.server":"<Gateway Server name>"}' -H 'Content-Type: application/json' -H 'Accept: application/json' -H "Authorization:<Authorization token>"  <Application Server host name>:8280/dh-services/agent-data/v1/register-node

    Note: If you are running the cURL command on a Windows machine, make sure that the double quotes are escaped. Otherwise, the command will not work.
    For example, use the following command on a Windows machine:

    curl.exe -v --insecure --request POST --data "{\"agent.list.name\":\"<Agent_list_name>\",\"agent.name\":\"<node_name>\",\"gateway.server\":\"<GWS_hostname>\"}" -H "Content-Type:application/json" -H "Accept:application/json" -H "Authorization":"<token>" hostname:8280/dh-services/agent-data/v1/register-node
    • (optional) Agent list name - Specify the name of the Agent list where you want to add the Agent system name. 
      • If you specify the list name that does not exist, a new list with the specified name is created.
      • If you do not specify the list name, a new list with "default" name is created.
    • (required) Agent name - Specify the host name of the managed system where the Agent is installed.
    • (optional) Gateway Server name - Specify the name of the Gateway Server to be used for registering the Agent. If you do not specify the Gateway Server name, any random Gateway Server is selected.
    • (required) Authorization token - Paste the authorization token that you copied from the API key.
    • (required) Application Server host name - Specify the host name of the Application Server to which the Gateway Server is connected.

    The sample cURL POST request:

    curl --insecure --request POST --data '{"agent.list.name":"newlist","agent.name":"test.bmc.com","gateway.server":"example.bmc.com"}' -H 'Content-Type: application/json' -H 'Accept: application/json' -H "Authorization: Bearer tjRXN6FtzukLUY5BPzKjumNtdCkJTM_xzW5EzseS_kr4orYhHegs_RKbpPPV9pzn8KsnLPDa0waDheGRsnRfkc8xSzmRY-VSsAFL26Om5zTrVDitNpsKBf33mY1J9t9ixdwag7vtLVOgL_TImRlY9Q"  https:server.bmc.com:8280/dh-services/agent-data/v1/register-node

     

  4. Run this cURL command from any of your systems and check the response.
  5. Confirm that the Agent list is created or updated by performing the following steps:

    1. Log in to the TrueSight Capacity Optimization console.
    2. Select Administration > Gateway Manager > Gateway Server.
    3. Click the Gateway Server name where you registered the new Agent system.
    4. Download the Agent list that you created or updated and verify that the name of the new managed system is available in the list.

The Gateway Server starts collecting data from the newly registered Agent.

To register the Agent running within a Docker container

You can register the Agent running within a Docker container using different methods. This section explains the registration process by using cURL commands in a Kubernetes pod.

Prerequisites

  • Ensure that the Docker container running the Agent is added to the Kubernetes pod.
  • Ensure that you obtain the authorization token by generating an API key. For more information, see Generating an API key.

Registration procedure

  1. Download the attached tsco_agent.yaml file.
  2. Open the file in a text editor and specify values for the following parameters:
    • (required) TSCO_AS - The name of Application Server to which the Gateway Server is connected.
    • (optional) TSCO_GWS - The name of the Gateway Server.
    • (optional) TSCO_AGENT_LIST - The name of the Agent list that you want to create or update.
    • (required) TSCO_JWT_TOKEN - The authorization token from the API key.
  3. Log in to the Kubernetes host as a root user.
  4. Use this command to run the Agent pod:
    kubectl apply -f <path>/tsco_agent.yaml
  5. Confirm that the Agent list is created or updated by performing the following steps:
    1. Log in to the TrueSight Capacity Optimization console.
    2. Select Administration > Gateway Manager > Gateway Server.
    3. Click the Gateway Server name where you registered the new Agent system.
    4. Download the Agent list that you created or updated and verify that the name of the new managed system is available in the list.

The Gateway Server starts collecting data from the newly registered Agent.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*