To protect your resources, the CloudMonitor agent automatically exits if the amount of resources that you consume exceeds a specific threshold. This topic describes how to handle an issue where the process of the CloudMonitor agent automatically exists on a Windows or Linux server.
You can manage the CloudMonitor agent only by using an administrator account. For Linux operating systems, use the root user account. For Windows operating systems, use the Administrator account. If you use an administrator account, certain risks may occur. For example, system stability or data security issues may occur. Proceed with caution.
Windows
Log on to the server on which the CloudMonitor agent runs as an administrator.
Go to the C:\Program Files\Alibaba\cloudmonitor\local_data\logs directory in which the CloudMonitor agent logs are stored and view the logs in the argusagent.log file.
If the logs in the argusagent.log file contain the
exceeds the maxValue
message, the amount of resources that you consumed exceeds the limit. Examples:[WARN ]2022-12-07 23:54:55.805854 [4148] self_monitor.cpp(line:85):the agent's cpu usage(52.55%) exceeds the maxValue(50.00%)
[WARN ]2022-12-07 23:54:55.805861 [4148] self_monitor.cpp(line:109):the agent will exit, as the agent cpu-usage exceeds the maxValue 4 times
Go to the C:\Program Files\Alibaba\cloudmonitor/local_data directory in which the CloudMonitor agent resides and modify the parameters that are related to resource limits in the agent.properties file.
Modify the parameters based on your business scenario. The following configurations are provided for reference only:
# The maximum size of memory usage. Unit: MB. agent.resource.memory.limit=200 # The maximum number of files that can be opened. In this example, the value is provided for reference only. Specify the value based on the maximum number of opened files supported by the system. agent.resource.fd.limit=100 # The maximum CPU utilization per core. In this example, the maximum CPU utilization per core is 10%. agent.resource.cpu.limit=0.1
Go to the C:\Program Files\Alibaba\cloudmonitor directory in which the CloudMonitor agent resides and delete the agent.status file.
Double-click stop.bat to stop the CloudMonitor agent.
Double-click start.bat to start the CloudMonitor agent.
Linux
Log on to the server on which the CloudMonitor agent runs as a root user.
Run the following commands to go to the /usr/local/cloudmonitor/local_data/logs directory in which the CloudMonitor agent logs are stored and view the levels of the logs in the argusagent.log file:
cd /usr/local/cloudmonitor/local_data/logs
cat argusagent.log
If the logs in the argusagent.log file contain the
exceeds the maxValue
message, the amount of resources that you consumed exceeds the limit. Examples:[WARN ]2022-12-07 23:54:55.805854 [4148] self_monitor.cpp(line:85):the agent's cpu usage(52.55%) exceeds the maxValue(50.00%)
[WARN ]2022-12-07 23:54:55.805861 [4148] self_monitor.cpp(line:109):the agent will exit, as the agent cpu-usage exceeds the maxValue 4 times
In the /usr/local/cloudmonitor/local_data directory in which the CloudMonitor agent resides, modify the parameters that are related to resource limits in the agent.properties file.
Run the following commands to modify the agent.properties file in the /usr/local/cloudmonitor/local_data directory:
cd /usr/local/cloudmonitor/local_data
vi agent.properties
Modify the parameters based on your business scenario. The following configurations are provided for reference only:
# The maximum size of memory usage. Unit: MB. agent.resource.memory.limit=200 # The maximum number of files that can be opened. In this example, the value is provided for reference only. Specify the value based on the maximum number of opened files supported by the system. agent.resource.fd.limit=100 # The maximum CPU utilization per core. In this example, the maximum CPU utilization per core is 10%. agent.resource.cpu.limit=0.1
Press the Esc key, enter :wq, and then press the Enter key to save and close the agent.properties file.
Run the following command to delete the agent.status file from the /usr/local/cloudmonitor directory in which the CloudMonitor agent resides:
rm /usr/local/cloudmonitor/agent.status
Run the following command to restart the CloudMonitor agent:
./cloudmonitorCtl.sh restart