Install and uninstall the Cloud Monitor agent

更新时间:
复制 MD 格式

The Cloud Monitor agent collects monitoring metrics from a host's operating system and sends the data to Cloud Monitor for analysis. You can view the host's status in visual charts and create alert rules for key metrics to identify and resolve issues promptly. This topic describes how to install, manage, and uninstall the Cloud Monitor agent.

Important

You can only manage the Cloud Monitor agent by using an administrator account (the root user for Linux or the Administrator user for Windows). However, using an administrator account may introduce certain risks, such as system stability or data security issues. Proceed with caution.

Before you begin

Agent version

C++ 3.X is the recommended version.

The Java and Go versions of the agent are no longer maintained. The C++ version uses significantly fewer resources than the Go and Java versions. Therefore, we recommend installing the C++ version of the agent.

The following table compares the control script paths for legacy and current Agent versions:

Version

Control Script Path

Notes

Legacy (Java/Go)

/usr/local/cloudmonitor/wrapper/bin/cloudmonitor.sh

Deprecated; the wrapper directory exists only in legacy versions

Current (C++)

/usr/local/cloudmonitor/cloudmonitorCtl.sh

Recommended; no wrapper directory

Note

The /usr/local/cloudmonitor/wrapper/ directory does not exist in the C++ version. If running a legacy command returns a "no such file or directory" error, your host has the C++ version installed — use cloudmonitorCtl.sh for all operations instead.

  • Billing: Installing the Cloud Monitor agent, viewing host monitoring charts, and creating alert rules are free of charge.

  • System requirements

    Operating system

    Hardware architecture

    Windows 7, Windows Server 2008 R2, and later

    i386, AMD64

    Linux 2.6.23 and later (must include the Glibc library)

    i386, AMD64, ARM64

    The Cloud Monitor agent is compatible with any Linux distribution that meets the following conditions: the kernel version is 2.6.23 or later, and the Glibc library is included. Commonly compatible distributions include (but are not limited to) CentOS, Ubuntu, Debian, Alibaba Cloud Linux, Anolis OS, Rocky Linux, AlmaLinux, and Kylin OS.

    Basic monitoring metrics (such as CPU usage and network traffic) are collected directly from the host and do not require the agent, so they are not affected by the Linux distribution. OS-level metrics such as memory usage and disk usage require the Cloud Monitor agent to be installed before they can be collected.

    For supported installation paths, resource consumption, and logs for the C++ agent, see Cloud Monitor agent overview.

Host network requirements

  • The host must be able to access the internet, either directly or through a NAT Gateway or a proxy server.

  • Firewall allowlist configuration

    If a firewall or an ECS security group is configured for the host, you must add the Cloud Monitor server addresses and ports to the allowlist.

    Note

    Third-party hosts use port 443 to report data and perform heartbeat checks over the internet.

    Server address

    Query method

    Server port

    Description

    Heartbeat service

    nslookup cms-cloudmonitor.aliyun.com or ping cms-cloudmonitor.aliyun.com

    8080, 3128, 443

    Used for agent heartbeat checks.

    Data reporting

    VPC: nslookup metrichub-<regionid>.aliyun.com

    Internet: nslookup metrichub-cms-<regionid>.aliyuncs.com

    80, 443

    Used to report monitoring data.

    • <regionid> is the region ID of the Alibaba Cloud host. Run the following command to obtain the region ID: curl http://100.100.100.200/latest/meta-data/region-id.

    • Data reporting over the internet is available only in the China (Hangzhou), China (Shanghai), China (Beijing), and China (Shenzhen) regions.

    Metadata service

    Fixed CIDR block: 100.100.0.0/16

    0-65535

    Obtains instance information (Alibaba Cloud hosts only).

Fix DNS resolution failures

This section applies only to Linux hosts.

If nslookup cms-cloudmonitor.aliyun.com returns Name or service not known or no servers could be reached, the host cannot resolve the Cloud Monitor heartbeat service domain, and the Cloud Monitor agent goes offline. Fix the issue by following these steps:

  1. Edit /etc/resolv.conf and add the following Alibaba Cloud internal DNS servers:

    nameserver 100.100.2.136
    nameserver 100.100.2.138
  2. Restart the Cloud Monitor agent:

    cd /usr/local/cloudmonitor && ./cloudmonitorCtl.sh restart
  3. Verify that the agent processes are running:

    ps aux | grep argusagent

    Normally, two to three processes are displayed (daemon, wrapper, and main process).

  4. Test DNS resolution again:

    nslookup cms-cloudmonitor.aliyun.com

    If an IP address is returned, DNS resolution has been restored.

Comparison of installation methods

Install the agent automatically or manually based on your host type and network environment.

Installation method

Use cases

Benefits

Automatic installation from the console

Alibaba Cloud ECS instances and third-party hosts managed by Cloud Assistant.

Recommended. This simple method supports batch operations and does not require logging on to the host.

Manual installation

Scenarios where automatic installation is unavailable, unmanaged third-party hosts, internal or offline environments, and deployments that use automation scripts such as Ansible.

Highly flexible and suitable for all complex environments.

Installation notes

  • Installing the Cloud Monitor agent does not affect business operations or require restarting your ECS instance. After installation, the agent starts automatically and begins collecting monitoring data. If you are concerned about the impact, install the agent during off-peak hours.

  • Automatic installation does not change the root account's login state (for example, noLogin). Even if direct root login is disabled on the host, Cloud Assistant Agent (aliyun-service) can still perform the installation on behalf of root.

  • The Cloud Monitor agent (argusagent) and the Simple Log Service collection agent (loongcollector) are independent components with no dependency on each other. Installing, uninstalling, or restarting one does not affect the other.

  • For non-ECS hosts such as Simple Application Servers, you must install the Cloud Monitor agent to view OS-level metrics such as memory and disk usage in the console. Basic monitoring metrics such as CPU usage and network traffic are collected from the host and do not require the agent.

Automatic installation (Recommended)

This method applies to Alibaba Cloud hosts and Alibaba Cloud-managed instances.

  1. Go to the Host Monitoring page.

  2. On the Host Monitoring page, select the hosts on which you want to install or upgrade the agent, and then click Batch Install/Upgrade Agent in the lower-left corner. In the dialog box that appears, click OK.

    Note
    • For newly purchased Alibaba Cloud hosts, you can turn on the Automatically Install CloudMonitor Agent on Newly Purchased ECS Instances switch in the upper-right corner. Once enabled, the Cloud Monitor agent is automatically installed on new ECS hosts. Otherwise, you must install the agent manually.

    • The installation or upgrade takes about 5 minutes. When the Agent Status of a target host changes from Installing to Running, the operation is complete.

Manual installation

Note

Install the agent manually if automatic installation fails or if you are installing in a special environment. If an older or corrupted version of the agent is already on the host, you must uninstall it first.

Note

Simple Application Server instances do not appear in the Host Monitoring list. The host type filter on the Host Monitoring page offers only ECS instances and third-party hosts, so you cannot obtain the installation command from the Manual Installation dialog box for a Simple Application Server instance. Connect to the instance over SSH and install the agent manually instead.

Log on to the Simple Application Server instance over SSH as the root user, and then run the following command to install the Cloud Monitor agent:

ARGUS_VERSION=4.0.0 /bin/bash -c "$(curl -s https://cms-agent-cn-shenzhen.oss-cn-shenzhen-internal.aliyuncs.com/Argus/agent_install-2.0.3.sh)"

Replace cn-shenzhen in the command with the region ID of the instance. ARGUS_VERSION specifies the agent version to install. After the command finishes, run the following command to confirm that the agent process is running:

ps aux | grep argusagent

The monitoring data of Simple Application Server instances is not displayed on the Host Monitoring page. After the agent is installed, log on to the Cloud Monitor console and choose Cloud Service Monitoring > Compute > Simple Application Server to view the monitoring data. The corresponding namespace is acs_swas.

  1. Go to the Host Monitoring page.

  2. On the Host Monitoring page, click Host & Agent Operations above the host list, and then click Manual Installation from the drop-down menu.

  3. In the Manual Installation dialog box, follow the steps below to complete the installation.

Alibaba Cloud hosts

Linux

  1. In the Region field, select the region where the Alibaba Cloud host is located.

  2. In the Installation Command area, click the image.png icon next to the command to copy the command. Select Linux or Windows as the operating system to obtain the corresponding installation command in the Installation Command area.

  3. Log on to the host as the root user.

  4. Paste and run the installation command.

  5. Run the following command to check the agent status:

    ps aux | grep argusagent | grep -v grep

    If the output resembles the following, the agent is running correctly.

    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

Windows

  1. In the Region field, select the region where the Alibaba Cloud host is located.

  2. Download the 32-bit or 64-bit agent package based on the host's operating system.

  3. Log on to the host as the Administrator user.

  4. Create the directory C:\Program Files\Alibaba\cloudmonitor. Upload the plugin package to the host, and decompress it to the directory C:\Program Files\Alibaba\cloudmonitor.

  5. To open Command Prompt, press Win+R to open the Run dialog box, enter cmd, and click OK.

  6. Run the following commands to install the Cloud Monitor agent:

    1. cd C:\Program Files\Alibaba\cloudmonitor\bin

    2. argusagent_service.exe install

  7. Run the net start argusagent command to start the Cloud Monitor agent.

  8. Check the agent status.

    1. To open the Service window, press Win+R to open the Run dialog box, enter services.msc, and then click OK.

    2. Check the status of the argusagent service. If the status is Running, the agent is running correctly.

Third-party hosts

Linux

  1. In the Region field, select a region to receive monitoring data.

  2. In the Manual Installation dialog box, configure the required parameters to generate the installation command. In the Installation Command area, click the copy icon image.png to copy the command.

  3. Log on to the host as the root user.

  4. Paste and run the installation command.

  5. Run the following command to check the agent status:

    ps aux | grep argusagent | grep -v grep

    If the output resembles the following, the agent is running correctly.

    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

Windows

  1. In the Region field, select a region to receive monitoring data.

  2. Download the agent package (32-bit or 64-bit, depending on the host's operating system) and the accesskey.properties configuration file.

  3. Log on to the host as the Administrator user.

  4. Create the directory C:\Program Files\Alibaba\cloudmonitor. Upload the plugin package to the host, and extract it to the directory C:\Program Files\Alibaba\cloudmonitor.

  5. Upload the configuration file to the host and place it in the C:\Program Files\Alibaba\cloudmonitor\local_data\conf directory.

  6. Run the following commands to install the Cloud Monitor agent:

    1. cd C:\Program Files\Alibaba\cloudmonitor\bin

    2. argusagent_service.exe install

  7. Run the net start argusagent command to start the Cloud Monitor agent.

  8. Check the agent status.

    1. To open the Service window, press Win+R to open the Run dialog box, enter services.msc, and then click OK.

    2. Check the status of the argusagent service. If the status is Running, the agent is running correctly.

Common issue

If a third-party host with the Cloud Monitor agent cannot access the internet, the agent cannot report monitoring data. To resolve this, configure a proxy server by modifying the agent.properties configuration file for the corresponding operating system.

  • Linux path: /usr/local/cloudmonitor/local_data/conf/agent.properties

  • Windows path: C:\Program Files\Alibaba\cloudmonitor\local_data\conf\agent.properties

For detailed steps, see How do I use an Nginx proxy server to report monitoring data from a third-party host?.

Troubleshooting

If the Cloud Monitor agent fails to install or start, refer to the following solutions.

Scenario 1: Clicking Install or Start in the console multiple times has no effect

Log on to the host and run the following command to start Cloud Assistant (aliyun-service). Then retry the operation in the console.

systemctl start aliyun-service

Scenario 2: Installation fails on a Simple Application Server

Perform the following checks in sequence:

  1. Verify metadata service connectivity. Run the following command:

    curl http://100.100.100.200/latest/meta-data/region-id

    If a region ID is returned, connectivity is normal.

  2. Verify agent download URL connectivity. Replace <region> with your actual region ID and run:

    ping cms-agent-<region>.oss-<region>.aliyuncs.com
  3. Check whether the agent process is running:

    ps -ef | grep cms
  4. If all checks pass but installation still fails, use the manual installation method instead. For detailed steps, see Manual installation in this topic.

Scenario 3: Agent status shows Reinstalling/Upgrading or the operation fails

Check whether Cloud Assistant Agent (aliyun-service) is running. If it is not, restart or repair it and then retry the Cloud Monitor agent installation. If the issue persists, manually reinstall the Cloud Monitor agent.

Scenario 4: Agent connection failure (general)

  1. Uninstall the Cloud Monitor agent and then reinstall it.

  2. If the issue persists, try installing a specific version (for example, version 1.0.6) to determine whether the issue is version-related.

Migrate from Legacy Agent

If your host runs a legacy Java or Go Agent — identifiable by the presence of the /usr/local/cloudmonitor/wrapper/ directory — follow the steps below to migrate to the C++ version, which provides lower resource usage and continued feature updates.

Steps (Linux)

  1. Stop the legacy Agent:

    bash /usr/local/cloudmonitor/wrapper/bin/cloudmonitor.sh stop
  2. Uninstall the legacy Agent:

    bash /usr/local/cloudmonitor/wrapper/bin/cloudmonitor.sh remove
    rm -rf /usr/local/cloudmonitor
  3. Install the C++ version by following the Manual Installation section in this document.

  4. Start the C++ Agent:

    bash /usr/local/cloudmonitor/cloudmonitorCtl.sh start
  5. Verify the Agent is running:

    ps aux | grep argusagent | grep -v grep

Common operations

Start the agent

  • Linux

    Run the following command to start the Cloud Monitor agent:

    bash /usr/local/cloudmonitor/cloudmonitorCtl.sh start
  • Windows

    Run the following command to start the Cloud Monitor agent:

    net start argusagent

Check the agent status

  • Linux

    Run the following command to check the agent status:

    ps aux | grep argusagent | grep -v grep

    If the output resembles the following, the agent is running correctly.

    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
  • Windows

    1. To open the Service window, press Win+R to open the Run dialog box, enter services.msc, and then click OK.

    2. Check the status of the argusagent service.

      If the status is Running, the agent is running correctly.

Stop the agent

  • Linux

    Run the following command to stop the Cloud Monitor agent:

    bash /usr/local/cloudmonitor/cloudmonitorCtl.sh stop
  • Windows

    Run the following command to stop the Cloud Monitor agent:

    net stop argusagent

Uninstall the agent

After uninstalling the C++ version of the Cloud Monitor agent, you can no longer monitor the host in real time, but historical monitoring data remains available.

  • Linux

    # 1. Stop the Cloud Monitor agent.
    bash /usr/local/cloudmonitor/cloudmonitorCtl.sh stop
    # 2. Uninstall the Cloud Monitor agent.
    bash /usr/local/cloudmonitor/cloudmonitorCtl.sh uninstall
    # 3. Delete the cloudmonitor directory.
    rm -rf /usr/local/cloudmonitor

    If the cloudmonitorCtl.sh script does not exist, uninstall the agent by performing the following steps:

    1. Locate the agent directory: find / -name cloudmonitor -type d

    2. Stop the service: systemctl stop cloudmonitor

    3. Disable the service: systemctl disable cloudmonitor

    4. Terminate residual processes: kill -9 $(pgrep argusagent)

      Note

      The argusagent service is configured with KillMode=none, so systemctl stop does not terminate the process. A running process recreates the /usr/local/cloudmonitor directory. Therefore, you must terminate the process before you delete the directory.

    5. Delete the agent directory: rm -rf /usr/local/cloudmonitor

    6. Delete the service file: rm -f /etc/systemd/system/cloudmonitor.service

    7. Reload systemd: systemctl daemon-reload

    8. Delete the configuration directory: rm -rf /etc/cloudmonitor

    After the uninstallation, run the following commands to verify that the agent is completely removed:

    • systemctl status cloudmonitor returns not-found.

    • ls /usr/local/cloudmonitor reports No such file or directory.

    • ps aux | grep argusagent returns no process.

    • find / -name cloudmonitor -type d returns no result.

  • Windows

    # 1. Stop the Cloud Monitor agent.
    net stop argusagent
    # 2. Uninstall the Cloud Monitor agent.
    "C:\Program Files\Alibaba\cloudmonitor\bin\argusagent_service.exe" uninstall
    # 3. Delete the cloudmonitor directory.
    cd "C:\Program Files\Alibaba"
    rd /s /q cloudmonitor
    Note

    If the installation path contains spaces (for example, C:\Program Files\Alibaba\cloudmonitor), you must enclose the full executable path in double quotation marks in the uninstall command, as shown in step 2. Without the quotation marks, Windows fails to locate the executable and returns the error '...' is not recognized as an internal or external command.

    If you encounter permission errors or command execution failures, verify that the current Windows user has Administrator privileges and that the file path is correct.

FAQ

Q: Why are some monitoring metrics (such as memory usage and disk usage) not displayed or are missing after I install the Cloud Monitor agent?

A:

  1. There is a brief delay between data collection and reporting. Wait a few minutes and then refresh the console.

  2. Check whether the agent status is Running. If the status is Stopped, go to the Host Monitoring page in the console to start the agent, or log on to the host and run:

    systemctl start aliyun-service
  3. Note the difference between basic monitoring and OS monitoring: basic monitoring metrics (such as CPU usage and network traffic) are collected from the host and do not require the agent. OS-level metrics such as memory and disk usage require the Cloud Monitor agent. If the agent is not installed or is not functioning correctly, these metrics are unavailable.

  4. If alerts are not triggered as expected (for example, no alert when disk usage reaches 100%), verify that the agent is installed and running. Monitoring data must be successfully reported before alert rules can take effect.

Q: After I uninstall the Cloud Monitor agent, I still see a running process. Why does this happen?

A:

If a process named aliyun_assist (or aliyun-service) is still running after you uninstall the Cloud Monitor agent (argusagent), this process belongs to the Cloud Assistant Agent (aliyun-service), which is an independent product from the Cloud Monitor agent. Uninstalling the Cloud Monitor agent does not automatically uninstall the Cloud Assistant Agent. If you no longer need the Cloud Assistant Agent, see Stop and uninstall agent to uninstall it separately.

Related documents

FAQ

API