nav-img
Advanced

How Do I Change the Agent Resource Consumption Threshold by Modifying the Configuration File?

This following describes how to modify the configuration file to change the Agent resource consumption threshold.

  1. Use the root account to log in to the ECS or BMS for which the Agent does not report data.
  2. Modify the conf.json configuration file.
    1. Go to the Agent installation path bin by running the following command:

      Windows:

      cd C:\Program Files\uniagent\extension\install\telescope

      Linux:

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

    2. Open conf.json.
      vi conf.json
    3. Add the following parameters to the conf.json file.
      {
      "cpu_first_pct_threshold": xx,
      "memory_first_threshold": xxx,
      "cpu_second_pct_threshold": xx,
      "memory_second_threshold": xxx
      }
      Table 1 Parameters in the conf.json file

      Parameter

      Description

      Value

      cpu_first_pct_threshold

      Tier-1 threshold of CPU usage. The default value is 10 (%).

      To query the CPU usage and memory usage of the Agent process, use either of the following methods:

      • Linux:

        top -p telescope PID

      • Windows:

        View the details of the Agent process in Task Manager.

      memory_first_threshold

      Tier-1 threshold of memory usage. The default value is 209715200 (200 MB). The unit is byte.

      cpu_second_pct_threshold

      Tier-2 threshold of CPU usage. The default value is 30 (%).

      memory_second_threshold

      Tier-2 threshold of memory usage. The default value is 734003200 (700 MB). The unit is byte.

    4. Save the conf.json file and exit.
      :wq
  3. Modify the manifest.json configuration file.
    1. Switch to the manifest.json file directory.

      Windows:

      cd C:\Program Files\uniagent\extension\holder\telescope

      Linux:

      cd /usr/local/uniagent/extension/holder/telescope

    2. Open manifest.json.
      vi manifest.json
    3. Modify the parameters mem and cpuUsage in resourceLimit, three groups in total. Retain the values of other parameters.
      [
      {
      "arch": "amd64",
      ...
      "resourceLimit": {
      "mem": 200,
      "cpuUsage": 10
      }
      },
      {
      "arch": "arm64",
      ...
      "resourceLimit": {
      "mem": 200,
      "cpuUsage": 10
      }
      },
      {
      "arch": "amd64",
      "os": "linux",
      ...
      "resourceLimit": {
      "mem": 200,
      "cpuUsage": 10
      }
      }
      ]
      Table 2 Parameters in the manifest.json file

      Parameter

      Description

      "resourceLimit": {

      "mem": 200,

      "cpuUsage": 10

      }

      mem: memory threshold. The default value is 200, in MB.

      cpuUsage: CPU usage threshold. The default value is 10 (%).

    4. Save the manifest.json file and exit.
      :wq
  4. Restart the Agent.
    • Windows:
      1. In the C:\Program Files\uniagent\extension\install\telescope directory, double-click shutdown.bat to stop the Agent, and then run start.bat to start the Agent.
      2. In the C:\Program Files\uniagent\script directory, double-click shutdown.bat to stop the Agent, and then run start.bat to start the Agent.
    • Linux:
      /usr/local/uniagent/bin/uniagent stop
      /usr/local/uniagent/bin/uniagent start
      /usr/local/uniagent/extension/install/telescope/telescoped restart