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.
- Use the root account to log in to the ECS or BMS for which the Agent does not report data.
- Modify the conf.json configuration file.
- Go to the Agent installation path bin by running the following command:
Windows:
cd C:\Program Files\uniagent\extension\install\telescopeLinux:
cd /usr/local/uniagent/extension/install/telescope/bin - Open conf.json.
vi conf.json
- 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.
- Linux:
- Save the conf.json file and exit.
:wq
- Go to the Agent installation path bin by running the following command:
- Modify the manifest.json configuration file.
- Switch to the manifest.json file directory.
Windows:
cd C:\Program Files\uniagent\extension\holder\telescopeLinux:
cd /usr/local/uniagent/extension/holder/telescope - Open manifest.json.
vi manifest.json
- 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 (%).
- Save the manifest.json file and exit.
:wq
- Switch to the manifest.json file directory.
- Restart the Agent.
- Windows:
- 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.
- 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
- Windows: