Updated on 2024-04-17 GMT+08:00

(Optional) Manually Configuring the Agent (Linux)

Scenarios

After you install the Agent, configure it by clicking Restore Agent Configurations on the Cloud Eye console. If the Agent fails to be configured by clicking Restore Agent Configurations or due to other reasons, manually configure it by following the instructions provided in this topic.

This topic takes an ECS as an example.

Prerequisites

The Agent has been installed.

Procedure

  1. Log in to an ECS as user root.
  2. Run the following command to go to the Agent installation path bin:

    cd /usr/local/uniagent/extension/install/telescope/bin

  3. Modify configuration file conf.json.
    1. Run the following command to open conf.json:

      vi conf.json

    2. Modify the parameters in the file. For details, see Table 1.

      ECS parameters

      {
          "InstanceId":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
          "ProjectId": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
          "AccessKey": "XXXXXXXXXXXXXXXXXXXX",
          "SecretKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
          "RegionId": "xx-xx-xx",
          "ClientPort": 0,
          "PortNum": 200
      }

      BMS parameters

      {
          "InstanceId":"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
          "ProjectId": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
          "AccessKey": "XXXXXXXXXXXXXXXXXXXX",
          "SecretKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
          "RegionId": "xx-xx-xx",
          "ClientPort": 0,
          "PortNum": 200,
          "BmsFlag": true
      }
      Table 1 Public parameters

      Parameter

      Description

      InstanceId

      (Optional) Specifies the ECS ID. You can log in to the management console and view the ECS ID in the ECS list.

      NOTE:

      If you do not configure InstanceId, retain "InstanceId":"".

      If you configure it, ensure that the following two requirements are met:

      • The ECS ID must be unique at all sites, that is, in the same region, InstanceId used by the Agent cannot be the same. Otherwise, errors may occur.
      • The InstanceId value must be consistent with the actual ECS ID. Otherwise, you cannot see the OS monitoring data on Cloud Eye.

      ProjectId

      (Optional) Specifies the project ID.

      If you do not configure ProjectId, retain "ProjectId": "".

      If you configure it, perform the following operations:

      1. Log in to the Cloud Eye console, click the username in the upper right corner, and choose My Credentials.
      2. Under Projects, obtain the project ID for the region where the ECS is located.

      AccessKey/SecretKey

      To obtain the AK and SK, perform the following operations:

      Log in to the Cloud Eye console, click the username in the upper right corner, and choose My Credentials, and choose Access Keys.

      • If you have obtained the access key, obtain the AccessKey value and the SecretKey value in the credentials.csv file saved when you create Access Keys.
      • If no access keys are available, click Create Access Key to create one. Save the credentials.csv file and obtain the AccessKey value and the SecretKey value in it.
        NOTICE:
        • For security purposes, it is recommended that the user be an IAM user with the CES Administrator permissions only.

      RegionId

      Specifies the region ID. Contact the administrator to obtain it.

      ClientPort

      Specifies the start port number used by the Agent.

      NOTE:

      The default value is 0, indicating that the Agent will randomly use any port. Ports 1 to 1023 are reserved. You are advised not to specify a port in this range for the Agent.

      PortNum

      Specifies the number of ports configured for the Agent.

      NOTE:

      The default value is 200. If ClientPort is 5000, the port range will be 5000 to 5199.

  4. Modify configuration file conf_ces.json for the Cloud Eye metric collection module.
    1. Run the following command to open public configuration file conf_ces.json:

      vi conf_ces.json

    2. Modify the endpoint in conf_ces.json, and save the conf_ces.json file. For details, see Table 2.
      {
        "Endpoint": "https://ces.xx-xx-xx.xxx.com"
      }
      Table 2 Parameter setting of the metric collection module

      Parameter

      Description

      Endpoint

      Specifies the Cloud Eye URL in the region the ECS belongs to. Contact the administrator to obtain it.

      • After you configure the Agent, its status is still displayed as Uninstalled because no monitoring data is reported yet. Wait 3 to 5 minutes and refresh the page.
      • If the Agent is in the Running state and Monitoring Status is enabled, the Agent has been installed and has started to collect fine-grained metric data.