All Products
Search
Document Center

:Install the CloudMonitor agent for Go

Last Updated:Apr 02, 2024

This topic describes how to install the CloudMonitor agent for Go on an Elastic Compute Service (ECS) instance.

Important The CloudMonitor agent for Go is no longer upgraded. We recommend that you use the CloudMonitor agent for C++. For more information, see Install and uninstall the CloudMonitor agent for C++

System requirements

Operating system

Architecture

Remarks

Windows 7, Windows Server 2008 R2, or later

i386 or AMD64

N/A

Linux 2.6.23 or later with the GNU C Library

i386 or AMD64

CentOS 5.x and Red Hat Enterprise Linux 5.x are not supported.

Resource usage:

  • Installation package size: 10 to 15 MB.

  • Memory usage: 10 to 15 MB. If the shared space is counted, the used memory is about 20 MB. The size of the shared space depends on the system memory size.

  • CPU utilization: 1% to 2%.

  • Network: internal network. No Internet bandwidth is used.

Install the CloudMonitor agent for Go in Linux

Common commands

# Register the agent as a system service.
/usr/local/cloudmonitor/CmsGoAgent.linux-${ARCH}install
# Remove the agent from system services.
/usr/local/cloudmonitor/CmsGoAgent.linux-${ARCH} uninstall
# Start the agent.
/usr/local/cloudmonitor/CmsGoAgent.linux-${ARCH} start
# Stop the agent.
/usr/local/cloudmonitor/CmsGoAgent.linux-${ARCH} stop
# Restart the agent.
/usr/local/cloudmonitor/CmsGoAgent.linux-${ARCH} restart
# Uninstall the agent.
/usr/local/cloudmonitor/CmsGoAgent.linux-${ARCH} stop && \
/usr/local/cloudmonitor/CmsGoAgent.linux-${ARCH} uninstall && \
rm -rf /usr/local/cloudmonitor

Installation command

Run the region-specific installation command on the ECS instance as the root user.

  • China (Qingdao) (region ID: cn-qingdao)

    REGION_ID=cn-qingdao VERSION=2.1.55 \
    bash -c "$(curl https://cms-agent-cn-qingdao.oss-cn-qingdao-internal.aliyuncs.com/cms-go-agent/cms_go_agent_install.sh)"
  • China (Beijing) (region ID: cn-beijing)

    REGION_ID=cn-beijing VERSION=2.1.55 \
    bash -c "$(curl https://cms-agent-cn-beijing.oss-cn-beijing-internal.aliyuncs.com/cms-go-agent/cms_go_agent_install.sh)"
  • China (Zhangjiakou) (region ID: cn-zhangjiakou)

    REGION_ID=cn-zhangjiakou VERSION=2.1.55 \
    bash -c "$(curl https://cms-agent-cn-zhangjiakou.oss-cn-zhangjiakou-internal.aliyuncs.com/cms-go-agent/cms_go_agent_install.sh)"
  • China (Hohhot) (region ID: cn-huhehaote)

    REGION_ID=cn-huhehaote VERSION=2.1.55 \
    bash -c "$(curl https://cms-agent-cn-huhehaote.oss-cn-huhehaote-internal.aliyuncs.com/cms-go-agent/cms_go_agent_install.sh)"
  • China (Hangzhou) (region ID: cn-hangzhou)

    REGION_ID=cn-hangzhou VERSION=2.1.55 \
    bash -c "$(curl https://cms-agent-cn-hangzhou.oss-cn-hangzhou-internal.aliyuncs.com/cms-go-agent/cms_go_agent_install.sh)"
  • China (Shanghai) (region ID: cn-shanghai)

    REGION_ID=cn-shanghai VERSION=2.1.55 \
    bash -c "$(curl https://cms-agent-cn-shanghai.oss-cn-shanghai-internal.aliyuncs.com/cms-go-agent/cms_go_agent_install.sh)"
  • China (Shenzhen) (region ID: cn-shenzhen)

    REGION_ID=cn-shenzhen VERSION=2.1.55 \
    bash -c "$(curl https://cms-agent-cn-shenzhen.oss-cn-shenzhen-internal.aliyuncs.com/cms-go-agent/cms_go_agent_install.sh)"
  • China (Hong Kong) (region ID: cn-hongkong)

    REGION_ID=cn-hongkong VERSION=2.1.55 \
    bash -c "$(curl https://cms-agent-cn-hongkong.oss-cn-hongkong-internal.aliyuncs.com/cms-go-agent/cms_go_agent_install.sh)"
  • US (Silicon Valley) (region ID: us-west-1)

    REGION_ID=us-west-1 VERSION=2.1.55 \
    bash -c "$(curl https://cms-agent-us-west-1.oss-us-west-1-internal.aliyuncs.com/cms-go-agent/cms_go_agent_install.sh)"
  • US (Virginia) (region ID: us-east-1)

    REGION_ID=us-east-1 VERSION=2.1.55 \
    bash -c "$(curl https://cms-agent-us-east-1.oss-us-east-1-internal.aliyuncs.com/cms-go-agent/cms_go_agent_install.sh)"
  • Singapore (region ID: ap-southeast-1)

    REGION_ID=ap-southeast-1 VERSION=2.1.55 \
    bash -c "$(curl https://cms-agent-ap-southeast-1.oss-ap-southeast-1-internal.aliyuncs.com/cms-go-agent/cms_go_agent_install.sh)"
  • Malaysia (Kuala Lumpur) (region ID: ap-southeast-3)

    REGION_ID=ap-southeast-3 VERSION=2.1.55 \
    bash -c "$(curl https://cms-agent-ap-southeast-3.oss-ap-southeast-3-internal.aliyuncs.com/cms-go-agent/cms_go_agent_install.sh)"
  • Indonesia (Jakarta) (region ID: ap-southeast-5)

    REGION_ID=ap-southeast-5 VERSION=2.1.55 \
    bash -c "$(curl https://cms-agent-ap-southeast-5.oss-ap-southeast-5-internal.aliyuncs.com/cms-go-agent/cms_go_agent_install.sh)"
  • Japan (Tokyo) (region ID: ap-northeast-1)

    REGION_ID=ap-northeast-1 VERSION=2.1.55 \
    bash -c "$(curl https://cms-agent-ap-northeast-1.oss-ap-northeast-1-internal.aliyuncs.com/cms-go-agent/cms_go_agent_install.sh)"
  • Germany (Frankfurt) (region ID: eu-central-1)

    REGION_ID=eu-central-1 VERSION=2.1.55 \
    bash -c "$(curl https://cms-agent-eu-central-1.oss-eu-central-1-internal.aliyuncs.com/cms-go-agent/cms_go_agent_install.sh)"
  • UK (London) (region ID: eu-west-1)

    REGION_ID=eu-west-1 VERSION=2.1.55 \
    bash -c "$(curl https://cms-agent-eu-west-1.oss-eu-west-1-internal.aliyuncs.com/cms-go-agent/cms_go_agent_install.sh)"
  • UAE (Dubai) (region ID: me-east-1)

    REGION_ID=me-east-1 VERSION=2.1.55 \
    bash -c "$(curl https://cms-agent-me-east-1.oss-me-east-1-internal.aliyuncs.com/cms-go-agent/cms_go_agent_install.sh)"
Note
  • The binary file of the CloudMonitor agent for Go is named in the following format: CmsGoAgent.linux-${ARCH}. The value of the ARCH parameter can be amd64 or i386. This value depends on the Linux system architecture.

  • We recommend that you use the latest version of the agent. You can find the latest version number on the Host Monitoring page in the CloudMonitor console.

Install the CloudMonitor agent for Go in Windows

  1. Download the agent installation program of the 64-bit version or 32-bit version based on the operating system type of the ECS instance. Copy the installation program to the C:\Program Files\Alibaba\cloudmonitor directory.

    Note

    You can also download the agent installation program by using an internal URL. For example, the internal URL for downloading the agent installation program of the 64-bit version in the China (Qingdao) region is http://cms-agent-cn-qingdao.oss-cn-qingdao-internal.aliyuncs.com/cms-go-agent/2.1.55/CmsGoAgent.windows-AMD64.exe. You can customize the URL as required in the following way:

    • Replace the two occurrences of cn-qingdao with the ID of the region where the ECS instance resides.

    • Replace AMD64 with i386 to download the 32-bit version.

    • Replace 2.1.55 with the required version number to download the agent of another version.

  2. Open a command prompt window as an administrator.

  3. Run the following commands:

    cd"C:\Program Files\Alibaba\cloudmonitor"
    CmsGoAgent.windows-amd64.exe install
    CmsGoAgent.windows-amd64.exe start
  4. After the agent is installed, view, start, or stop the argusagent service in Windows Services Manager.

Uninstall the CloudMonitor agent for Go in Windows

  1. Open a command prompt window as an administrator.

  2. Run the following commands:

    cd"C:\Program Files\Alibaba\cloudmonitor"
    CmsGoAgent.windows-amd64.exe stop
    CmsGoAgent.windows-amd64.exe uninstall
  3. Close the command prompt window.

  4. Delete the C:\Program Files\Alibaba\cloudmonitor directory.

Security configuration instructions

The following table lists the IP addresses and ports that the CloudMonitor agent uses to interact with CloudMonitor servers. If the ports are disabled by security software, the CloudMonitor agent fails to report monitoring data to CloudMonitor. If you use a whitelist to limit the IP addresses that your ECS instance can access, we recommend that you add the IP addresses described in the following table to the whitelist.

Note
  • CloudMonitor may change the IP addresses that it uses to provide services in the future versions. However, all the IP addresses will reside in the 100.0.0.0/8 CIDR block, which is the reserved internal CIDR block that Alibaba Cloud uses to provide services. Therefore, you can allow outbound traffic to the 100.0.0.0/8 CIDR block for your ECS instance. This simplifies the whitelist configuration.

  • The IP addresses in brackets [] are optional. They are used as backup IP addresses when the network is unstable.

Region

IP address

Direction

Description

China (Hangzhou) (region ID: cn-hangzhou)

100.100.19.43:3128

Outbound

Used for control operations, such as management of monitoring configurations.

100.100.45.73:80

Outbound

Used to collect monitoring data to CloudMonitor.

China (Beijing) (region ID: cn-beijing)

100.100.18.22:3128

Outbound

Used for control operations, such as management of monitoring configurations.

100.100.18.50:80

Outbound

Used to collect monitoring data to CloudMonitor.

China (Qingdao) (region ID: cn-qingdao)

100.100.36.102:3128

Outbound

Used for control operations, such as management of monitoring configurations.

100.100.15.23:80

Outbound

Used to collect monitoring data to CloudMonitor.

China (Shenzhen) (region ID: cn-shenzhen)

100.100.0.13:3128

Outbound

Used for control operations, such as management of monitoring configurations.

100.100.0.31:80

Outbound

Used to collect monitoring data to CloudMonitor.

China (Hong Kong) (region ID: cn-hongkong)

100.103.0.47:3128

Outbound

Used for control operations, such as management of monitoring configurations.

100.103.0.45:80

Outbound

Used to collect monitoring data to CloudMonitor.

China (Hohhot) (region ID: cn-huhehaote)

100.100.80.135:8080

Outbound

Used for control operations, such as management of monitoring configurations.

100.100.80.12:80

Outbound

Used to collect monitoring data to CloudMonitor.

China (Zhangjiakou) (region ID: cn-zhangjiakou)

100.100.80.92:8080

Outbound

Used for control operations, such as management of monitoring configurations.

100.100.0.19:80

Outbound

Used to collect monitoring data to CloudMonitor.

China (Shanghai) (region ID: cn-shanghai)

100.100.36.11:3128

Outbound

Used for control operations, such as management of monitoring configurations.

100.100.36.6:80

Outbound

Used to collect monitoring data to CloudMonitor.

China (Chengdu) (region ID: cn-chengdu)

100.100.80.229:8080

Outbound

Used for control operations, such as management of monitoring configurations.

100.100.80.14:80

Outbound

Used to collect monitoring data to CloudMonitor.

US (Virginia) (region ID: us-east-1)

100.103.0.95:3128

Outbound

Used for control operations, such as management of monitoring configurations.

100.103.0.94:80

Outbound

Used to collect monitoring data to CloudMonitor.

US (Silicon Valley) (region ID: us-west-1)

100.103.0.95:3128

Outbound

Used for control operations, such as management of monitoring configurations.

100.100.29.7:80

Outbound

Used to collect monitoring data to CloudMonitor.

Germany (Frankfurt) (region ID: eu-central-1)

100.100.80.241:8080

Outbound

Used for control operations, such as management of monitoring configurations.

100.100.80.72:80

Outbound

Used to collect monitoring data to CloudMonitor.

UK (London) (region ID: eu-west-1)

100.100.0.3:8080

Outbound

Used for control operations, such as management of monitoring configurations.

100.100.0.2:80

Outbound

Used to collect monitoring data to CloudMonitor.

Singapore (region ID: ap-southeast-1)

100.100.30.20:3128

Outbound

Used for control operations, such as management of monitoring configurations.

100.100.103.7:80

Outbound

Used to collect monitoring data to CloudMonitor.

Malaysia (Kuala Lumpur) (region ID: ap-southeast-3)

100.100.80.153:8080

Outbound

Used for control operations, such as management of monitoring configurations.

100.100.80.140:80

Outbound

Used to collect monitoring data to CloudMonitor.

Indonesia (Jakarta) (region ID: ap-southeast-5)

100.100.80.160:8080

Outbound

Used for control operations, such as management of monitoring configurations.

100.100.80.180:80

Outbound

Used to collect monitoring data to CloudMonitor.

UAE (Dubai) (region ID: me-east-1)

100.100.80.142:8080

Outbound

Used for control operations, such as management of monitoring configurations.

100.100.80.151:80

[47.91.99.5:443]

Outbound

Used to collect monitoring data to CloudMonitor.

Japan (Tokyo) (region ID: ap-northeast-1)

100.100.80.184:8080

Outbound

Used for control operations, such as management of monitoring configurations.

100.100.80.137:80

[47.91.8.7:443]

Outbound

Used to collect monitoring data to CloudMonitor.

Usage notes

The CloudMonitor agent stores monitoring logs in the following directories:

  • Linux: /usr/local/cloudmonitor/logs

  • Windows: C:\Program Files\Alibaba\cloudmonitor\logs