To use CloudMonitor to collect metrics from a host operating system and configure alert rules for key metrics, you must install the CloudMonitor agent on the host. This helps you monitor metrics in real time. If you no longer need to use CloudMonitor to monitor a host, you can log on to the host to uninstall the CloudMonitor agent. This topic describes how to automatically install, manually install, and uninstall the CloudMonitor agent on a host.
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.
Background information
The CloudMonitor agent is available for the following programming languages: Java, Go, and C++. The CloudMonitor agent for C++ has the latest version. The CloudMonitor agents for Java and Go are no longer maintained. Upgrade the CloudMonitor agents for Java and Go to the CloudMonitor agent for C++ based on the instructions described in this topic. For more information about the versions of the CloudMonitor agent, operating system requirements, installation location on the host, processes running on the host, ports, resource consumption, and logs, see Agent overview.
CloudMonitor supports monitoring on Elastic Compute Service (ECS) instances and third-party hosts. Alibaba Cloud hosts include ECS instances and simple application servers. Third-party hosts include on-premises data centers, Tencent Cloud hosts, and AWS hosts. After you register a third-party host as an Alibaba Cloud managed instance by using Cloud Assistant Agent of ECS, you can view the host on the Host Monitoring page and the CloudMonitor agent is automatically installed on the host. You must manually install the CloudMonitor agent on a third-party host that is not managed by Alibaba Cloud. After you install the CloudMonitor agent, you can view the host on the Host Monitoring page.
You are not charged for installing the CloudMonitor agent. You can view the metrics and their monitoring charts on the Host Monitoring page. You can configure alert rules free of charge for desired metrics and directly use CloudMonitor Basic without activating it.
Prerequisites
Before you automatically install the CloudMonitor agent on a third-party host, make sure that you have registered the host as an Alibaba Cloud managed instance. For more information, see Alibaba Cloud managed instances.
Automatic installation (recommended)
We recommend that you use the related features in the CloudMonitor console to automatically install the CloudMonitor agent on ECS instances and third-party hosts.
Log on to the CloudMonitor console.
In the left-side navigation pane, click
.On the Host Monitoring page, select the ECS instances on which you want to install or upgrade the CloudMonitor agent and click Batch Install.
In the message that appears, click OK.
The installation or upgrade process requires about 5 minutes to complete. When the agent status changes from Installing to Running, the CloudMonitor agent is installed or upgraded.
NoteFor newly purchased ECS instances, you can turn on Automatically Install CloudMonitor Agent on Newly Purchased ECS Instances in the upper-right corner. If you turn off the switch, you must manually install the CloudMonitor agent on each ECS instance.
If the agent status on an ECS instance is Stopped or Failed to install, you can automatically or manually install the CloudMonitor agent.
Use a script to install the CloudMonitor agent
Use a script to install the CloudMonitor agent on an ECS instance
If the CloudMonitor agent fails to be automatically installed on an ECS instance, you must install the agent by using a script.
If the CloudMonitor agent fails to be automatically installed or upgraded on an ECS instance, you must uninstall the agent then use a script to install it. For more information about how to uninstall the CloudMonitor agent, see How do I uninstall the CloudMonitor agent?
Log on to the CloudMonitor console.
In the left-side navigation pane, click
.On the Host Monitoring page, find the ECS instance and click the icon in the argusagent Status column. If the ECS instance does not exist, click Host and Plug-in Operations in the upper part of the host list and then select Manual installation from the drop-down list.
In the Manual installation dialog box, set Host Type to ECS Instance, select the region and operating system of the host, and then follow the installation instruction and command on the page to install the CloudMonitor agent.
Windows
Download the agent package of the 32-bit version or 64-bit version based on the operating system of the host.
Use an administrator account to log on to the ECS instance on which you want to install the CloudMonitor agent.
Create the C:\Program Files\Alibaba\cloudmonitor directory.
Upload the agent package to the ECS instance and decompress the agent package to the C:\Program Files\Alibaba\cloudmonitor directory.
Open the Command Prompt.
Press Win+R. In the Run dialog box, enter cmd and click OK.
Run the following commands to install the CloudMonitor agent:
cd C:\Program Files\Alibaba\cloudmonitor\bin
argusagent_service.exe install
Run the following command to start the CloudMonitor agent:
net start argusagent
View the status of the CloudMonitor agent.
Open the Services window.
Press Win+R. In the Run dialog box, enter services.msc and click OK.
View the status of the argusagent service.
If the status of the argusagent service is Running, the CloudMonitor agent is running properly.
Linux
In the Installation Command section, click the icon next to the command to copy the command.
Log on to the host on which you want to install the CloudMonitor agent as the root user.
Paste and run the command to install the CloudMonitor agent.
Run the following command to view the status of the CloudMonitor agent:
ps aux | grep argusagent | grep -v grep
The following output indicates that the CloudMonitor agent is running properly:
root 2284 0.0 0.0 22516 1488 ? Ss Sep14 0:00 /usr/local/cloudmonitor/bin/argusagent -d root 2286 0.2 0.3 939652 14300 ? Sl Sep14 3:15 /usr/local/cloudmonitor/bin/argusagent
Use a script to install the CloudMonitor agent on a third-party host
If the CloudMonitor agent fails to be automatically installed or upgraded on a third-party host, you must uninstall the agent then use a script to install it. For more information about how to uninstall the CloudMonitor agent, see How do I uninstall the CloudMonitor agent?
Log on to the CloudMonitor console.
In the left-side navigation pane, click
.On the Host Monitoring page, find the ECS instance and click the icon in the argusagent Status column. If the ECS instance does not exist, click Host and Plug-in Operations in the upper part of the host list and then select Manual installation from the drop-down list.
In the Manual installation dialog box, set Host Type to Third-party Host, select the operating system of the host, and then follow the installation instruction and command on the page to install the CloudMonitor agent.
Windows
Download the agent package of the 32-bit version or 64-bit version based on the operating system of the host.
Download the accesskey.properties configuration file.
Use an administrator account to log on to the ECS instance on which you want to install the CloudMonitor agent.
Create the C:\Program Files\Alibaba\cloudmonitor directory.
Upload the agent package to the ECS instance and decompress the agent package to the C:\Program Files\Alibaba\cloudmonitor directory.
Upload the configuration file to the C:\Program Files\Alibaba\cloudmonitor\local_data\conf directory of the host.
- Open the command prompt window.
Press Win+R. In the Run dialog box, enter cmd and click OK.
Run the following commands to install the CloudMonitor agent:
cd C:\Program Files\Alibaba\cloudmonitor\bin
argusagent_service.exe install
Run the following command to start the CloudMonitor agent:
net start argusagent
View the status of the CloudMonitor agent.
Open the Services window.
Press Win+R. In the Run dialog box, enter services.msc and click OK.
View the status of the argusagent service.
If the status of the argusagent service is Running, the CloudMonitor agent is running properly.
Linux
If the host is accessible over the Internet, perform the following steps:
In the Installation Command section, click the icon next to the command to copy the command.
Log on to the host on which you want to install the CloudMonitor agent as the root user.
Paste and run the command to install the CloudMonitor agent.
Run the following command to view the status of the CloudMonitor agent:
ps aux | grep argusagent | grep -v grep
The following output indicates that the CloudMonitor agent is running properly:
root 2284 0.0 0.0 22516 1488 ? Ss Sep14 0:00 /usr/local/cloudmonitor/bin/argusagent -d root 2286 0.2 0.3 939652 14300 ? Sl Sep14 3:15 /usr/local/cloudmonitor/bin/argusagent
If the host is inaccessible over the Internet, perform the following steps:
NoteIf the CloudMonitor agent is installed on the host but the host is inaccessible over the Internet, the metric data cannot be reported to CloudMonitor. You must configure a proxy server in the CloudMonitor agent. For more information, see Substep 2 in Step 2: Install and configure the CloudMonitor agent.
Install a proxy server.
An NGINX proxy server is used in this example. For more information, see Substep 1 to Substep 4 in Step 1: Deploy an NGINX proxy server.
In the Installation Command section, click the icon next to the command to copy the command.
Log on to the host on which you want to install the CloudMonitor agent as the root user.
Paste and run the command to install the CloudMonitor agent.
Replace the parameters in the following command with the actual values. Keep the default values of other parameters.
CMS_HTTP_PROXY=<Address of the proxy server:Port number>
Run the following command to view the status of the CloudMonitor agent:
ps aux | grep argusagent | grep -v grep
The following output indicates that the CloudMonitor agent is running properly:
root 2284 0.0 0.0 22516 1488 ? Ss Sep14 0:00 /usr/local/cloudmonitor/bin/argusagent -d root 2286 0.2 0.3 939652 14300 ? Sl Sep14 3:15 /usr/local/cloudmonitor/bin/argusagent
Uninstall the CloudMonitor agent
After you uninstall the CloudMonitor agent for C++ from a host, you cannot monitor the host in real time in the CloudMonitor console. However, you can view the historical metric data.
Windows
Log on to the host where the CloudMonitor agent resides as the administrator.
- Open the command prompt window.
Press Win+R. In the Run dialog box, enter cmd and click OK.
Run the following command to stop the CloudMonitor agent:
net stop argusagent
Run the following command to uninstall the CloudMonitor agent:
"C:\Program Files\Alibaba\cloudmonitor\bin\argusagent_service.exe" uninstall
Run the following commands to delete the cloudmonitor directory:
cd C:\Program Files\Alibaba
rd /s /q cloudmonitor
Linux
Log on to the host where the CloudMonitor agent resides as a root user.
Run the following command to stop the CloudMonitor agent:
bash /usr/local/cloudmonitor/cloudmonitorCtl.sh stop
Run the following command to uninstall the CloudMonitor agent:
bash /usr/local/cloudmonitor/cloudmonitorCtl.sh uninstall
Run the following commands to delete the cloudmonitor directory:
rm -rf /usr/local/cloudmonitor
References
FAQ
What do I do if the CloudMonitor agent fails to be automatically installed on an ECS instance?
How do I troubleshoot an abnormal stop of the CloudMonitor agent?
What do I do if the process of the CloudMonitor agent automatically exits?
How do I troubleshoot the heartbeat check failure that is reported by the CloudMonitor agent?
API