This topic describes how to install the Java agent of Cloud Monitor on an Elastic Compute Service (ECS) instance.

Install the Java agent in Linux

Common commands

# View the status of the agent.
/usr/local/cloudmonitor/wrapper/bin/cloudmonitor.sh status

# Start the agent.
/usr/local/cloudmonitor/wrapper/bin/cloudmonitor.sh start

# Stop the agent.
/usr/local/cloudmonitor/wrapper/bin/cloudmonitor.sh stop

# Restart the agent.
/usr/local/cloudmonitor/wrapper/bin/cloudmonitor.sh restart

# Uninstall the agent.
/usr/local/cloudmonitor/wrapper/bin/cloudmonitor.sh remove && \
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=1.3.7 \
    bash -c "$(curl https://cms-agent-cn-qingdao.oss-cn-qingdao-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • China (Beijing) (region ID: cn-beijing)
    REGION_ID=cn-beijing VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-cn-beijing.oss-cn-beijing-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • China (Zhangjiakou) (region ID: cn-zhangjiakou)
    REGION_ID=cn-zhangjiakou VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-cn-zhangjiakou.oss-cn-zhangjiakou-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • China (Hohhot) (region ID: cn-huhehaote)
    REGION_ID=cn-huhehaote VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-cn-huhehaote.oss-cn-huhehaote-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • China (Hangzhou) (region ID: cn-hangzhou)
    REGION_ID=cn-hangzhou VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-cn-hangzhou.oss-cn-hangzhou-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • China (Shanghai) (region ID: cn-shanghai)
    REGION_ID=cn-shanghai VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-cn-shanghai.oss-cn-shanghai-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • China (Shenzhen) (region ID: cn-shenzhen)
    REGION_ID=cn-shenzhen VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-cn-shenzhen.oss-cn-shenzhen-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • China (Hong Kong) (region ID: cn-hongkong)
    REGION_ID=cn-hongkong VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-cn-hongkong.oss-cn-hongkong-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • US (Silicon Valley) (region ID: us-west-1)
    REGION_ID=us-west-1 VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-us-west-1.oss-us-west-1-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • US (Virginia) (region ID: us-east-1)
    REGION_ID=us-east-1 VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-us-east-1.oss-us-east-1-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • Singapore (region ID: ap-southeast-1)
    REGION_ID=ap-southeast-1 VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-ap-southeast-1.oss-ap-southeast-1-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • Australia (Sydney) (region ID: ap-southeast-2)
    REGION_ID=ap-southeast-2 VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-ap-southeast-2.oss-ap-southeast-2-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • Malaysia (Kuala Lumpur) (region ID: ap-southeast-3)
    REGION_ID=ap-southeast-3 VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-ap-southeast-3.oss-ap-southeast-3-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • Indonesia (Jakarta) (region ID: ap-southeast-5)
    REGION_ID=ap-southeast-5 VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-ap-southeast-5.oss-ap-southeast-5-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • Japan (Tokyo) (region ID: ap-northeast-1)
    REGION_ID=ap-northeast-1 VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-ap-northeast-1.oss-ap-northeast-1-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • India (Mumbai) (region ID: ap-south-1)
    REGION_ID=ap-south-1 VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-ap-south-1.oss-ap-south-1-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • Germany (Frankfurt) (region ID: eu-central-1)
    REGION_ID=eu-central-1 VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-eu-central-1.oss-eu-central-1-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • UK (London) (region ID: eu-west-1)
    REGION_ID=eu-west-1 VERSION=1.3.7 \ bash -c "$(curl https://cms-agent-eu-west-1.oss-eu-west-1-internal.aliyuncs.com/release/cms_install_for_linux.sh)"
  • UAE (Dubai) (region ID: me-east-1)
    REGION_ID=me-east-1 VERSION=1.3.7 \
    bash -c "$(curl https://cms-agent-me-east-1.oss-me-east-1-internal.aliyuncs.com/release/cms_install_for_linux.sh)"

Install the Java agent in Windows

  1. Download the agent installation package of the 64-bit version or 32-bit version based on the operating system type of the ECS instance.
  2. Create a directory named cloudmonitor in the C:\Program Files\Alibaba directory.
  3. Decompress the agent installation package to the C:\Program Files\Alibaba\cloudmonitor directory.
  4. Run the C:\Program Files\Alibaba\cloudmonitor\wrapper\bin\InstallApp-NT.bat file as an administrator to install the agent.
  5. Run the C:\Program Files\Alibaba\cloudmonitor\wrapper\bin\StartApp-NT.bat file as an administrator to start the agent.
  6. After you install the agent, view, start, or stop the Cloud Monitor Application service in Windows Services Manager.
Note If your ECS instance cannot access the Internet, you can download the agent installation package by using an internal URL. For example, you can download the agent installation package of the 64-bit version in the China (Qingdao) region by using this internal URL. 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 the two occurrences of windows64 with windows32 to download the 32-bit version.
  • Replace the two occurrences of 1.3.7 with the required version number to download the agent of another version.

Uninstall the Java agent in Windows

  1. Stop the Cloud Monitor Application service in Windows Services Manager.
  2. Run the C:\Program Files\Alibaba\cloudmonitor\wrapper\bin\UninstallApp-NT.bat file to uninstall the agent.
  3. Delete the C:\Program Files\Alibaba\cloudmonitor directory.

Security configuration instructions

The following table describes the IP addresses and ports that the Cloud Monitor agent uses to interact with Cloud Monitor servers. If the ports are disabled by security software, the Cloud Monitor agent fails to report monitoring data to Cloud Monitor. 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 Cloud Monitor 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.100 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.100 CIDR block for your ECS instance. This simplifies the whitelist configuration.
Region IP 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 Cloud Monitor.
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 Cloud Monitor.
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 Cloud Monitor.
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 Cloud Monitor.
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 Cloud Monitor.
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 Cloud Monitor.
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 Cloud Monitor.
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 Cloud Monitor.
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 Cloud Monitor.
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 Cloud Monitor.
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 Cloud Monitor.
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 Cloud Monitor.
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 Cloud Monitor.
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 Cloud Monitor.
Australia (Sydney) (region ID: ap-southeast-2) 100.100.80.92:8080 Outbound Used for control operations, such as management of monitoring configurations.

100.100.80.13:80

[47.91.39.6:443]

Outbound Used to collect monitoring data to Cloud Monitor.
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 Cloud Monitor.
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 Cloud Monitor.
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 Cloud Monitor.
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 Cloud Monitor.
India (Mumbai) (region ID: ap-south-1) 100.100.80.152:8080 Outbound Used for control operations, such as management of monitoring configurations.
100.100.80.66:80 Outbound Used to collect monitoring data to Cloud Monitor.

Resource usage

  • Installation package size: 75 MB.
  • Disk space occupied after installation: 200 MB.
  • Memory usage: 64 MB.
  • CPU utilization: less than 1%.
  • Network: internal network. No Internet bandwidth is used.

Usage notes

  • The Cloud Monitor agent stores monitoring logs in the following directories:
    • Linux: /usr/local/cloudmonitor/logs
    • Windows: C:\Program Files\Alibaba\cloudmonitor\logs
  • If the port used by the Cloud Monitor agent conflicts with the port used by your business application, you can change the port range in the /usr/local/cloudmonitor/wrapper/conf/wrapper.conf configuration file and restart the Cloud Monitor agent.
    wrapper.port.min=40000
    wrapper.port.max=41000
    wrapper.jvm.port.min=41001
    wrapper.jvm.port.max=42000