This topic describes how to automatically install, manually install, and uninstall the CloudMonitor agent for C++.
Automatically install the CloudMonitor agent for C++ (recommended)
This section describes how to automatically install the CloudMonitor agent for C++ on Elastic Compute Service (ECS) instances.
- Log on to the CloudMonitor console.
- In the left-side navigation pane, click Host Monitoring.
- On the Host Monitoring page, select the ECS instances on which you want to install or upgrade the CloudMonitor agent for C++ and click Batch Install.
- In the message that appears, click Confirm. The process requires about 5 minutes to complete. If the agent status changes from Installing to Running, the CloudMonitor agent for C++ is installed or upgraded.Note For newly purchased ECS instances, you can click Install/Upgrade Agent in the upper-left corner, and then turn on Automatically Install CloudMonitor Agent on Newly Purchased ECS Instances. If you turn off the switch, you must manually install the CloudMonitor agent for C++ on each ECS instance.
Manually install the CloudMonitor agent for C++ on an ECS instance
- Log on to the CloudMonitor console.
- In the left-side navigation pane, click Host Monitoring.
- On the Host Monitoring page, click Install/Upgrade Agent in the upper-left corner.
- In the Install CloudMonitor Agent panel, click the Script Installation tab.
- On the Script Installation tab, select the region and operating system of the ECS instance. Then, copy and run the displayed commands to install the CloudMonitor agent for C++.
- Windows
- Download the agent package of the 32-bit version or 64-bit version based on the operating system of the ECS instance.
- Use an administrator account to log on to the ECS instance on which you want to install the CloudMonitor agent for C++.
- 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 for C++:
cd C:\Program Files\Alibaba\cloudmonitor\bin
argusagent_service.exe install
- Run the following command to start the CloudMonitor agent for C++:
net start argusagent
- View the status of the CloudMonitor agent for C++.
- 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.
- Open the Services window.
Note If 360 Total Security is installed on your ECS instance, the CloudMonitor agent fails to be installed or the service fails to start. We recommend that you set the C:\Program Files\Alibaba\ directory as a trusted directory. - Linux
- Click the
icon in the Installation Command section.
- Log on to the host on which you want to install the CloudMonitor agent for C++ as the root user.
- Paste and run the command to install the CloudMonitor agent for C++.
- 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
- Click the
- Windows
Manually install the CloudMonitor agent for C++ on a third-party host
- Log on to the CloudMonitor console.
- In the left-side navigation pane, click Host Monitoring.
- On the Host Monitoring page, click Install/Upgrade Agent in the upper-left corner.
- In the Install CloudMonitor Agent panel, click the Script Installation tab.
- On the Script Installation tab, select the region and operating system of the host. Then, copy and run the displayed commands to install the CloudMonitor agent for C++.
- 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 host on which you want to install the CloudMonitor agent for C++.
- Create the C:\Program Files\Alibaba\cloudmonitor directory.
- Upload the agent package to the host 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 for C++:
cd C:\Program Files\Alibaba\cloudmonitor\bin
argusagent_service.exe install
- Run the following command to start the CloudMonitor agent for C++:
net start argusagent
- View the status of the CloudMonitor agent for C++.
- 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.
- Open the Services window.
Note If 360 Total Security is installed on your ECS instance, the CloudMonitor agent fails to be installed or the service fails to start. We recommend that you set the C:\Program Files\Alibaba\ directory as a trusted directory. - Linux
- If the host is accessible over the Internet, perform the following steps:
- Click the
icon in the Installation Command section.
- Log on to the host on which you want to install the CloudMonitor agent for C++ as the root user.
- Paste and run the command to install the CloudMonitor agent for C++.
- 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
- Click the
- If the host is inaccessible over the Internet, perform the following steps:Note If the CloudMonitor agent for C++ is installed on the host but the host is inaccessible over the Internet, the monitoring data cannot be reported to CloudMonitor. You must configure a proxy server in the CloudMonitor agent for C++. For more information, see Step 2: Install and configure the CloudMonitor agent 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.
- Click the
icon in the Installation Command section.
- Log on to the host on which you want to install the CloudMonitor agent for C++ as the root user.
- Paste and run the command to install the CloudMonitor agent for C++. 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
- Install a proxy server.
- If the host is accessible over the Internet, perform the following steps:
- Windows
Uninstall the CloudMonitor agent for C++
After you uninstall the CloudMonitor agent for C++ from a host, you cannot monitor the host in real time by using the CloudMonitor console. However, you can view the historical metric data.
- Windows
- Log on to the host where the CloudMonitor agent for C++ 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 for C++:
net stop argusagent
- Run the following command to uninstall the CloudMonitor agent for C++:
"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 for C++ resides as the root user.
- Run the following command to stop the CloudMonitor agent for C++:
bash /usr/local/cloudmonitor/cloudmonitorCtl.sh stop
- Run the following command to uninstall the CloudMonitor agent for C++:
bash /usr/local/cloudmonitor/cloudmonitorCtl.sh uninstall
- Run the following commands to delete the cloudmonitor directory:
rm -rf /usr/local/cloudmonitor
References
- How do I troubleshoot an abnormal stop of the CloudMonitor agent?
- How can I restart the CloudMonitor agent for C++?
- How do I uninstall the CloudMonitor agent?
- How do I troubleshoot the automatic installation failure of the CloudMonitor agent on an Alibaba Cloud instance?
- How do I troubleshoot the heartbeat check failure that is reported by the CloudMonitor agent?
- What can I do if CloudMonitor fails to identify multiple hosts that are deployed by using the same image?