Updated on 2025-08-14 GMT+08:00

Managing ICAgent

You can use ICAgent to collect logs to LTS. ICAgent is a log collection tool for LTS. It runs on hosts where logs need to be collected. This section describes how to install ICAgent on a host, upgrade ICAgent, uninstall ICAgent, and check the ICAgent status.

You can select one of the following solutions based on your server type. The usage process and configuration requirements vary in different scenarios.

  • Host solution: applicable to traditional computing environments, such as physical servers and ECSs. Hosts are classified into intra-region and extra-region hosts based on their locations.
  • Container solution: applicable to services deployed on Kubernetes container platforms.

Host Scenario

  • Installing ICAgent

    For details, see Installing ICAgent (Intra-Region Hosts) and .

  • Upgrading ICAgent

    LTS regularly updates ICAgent to improve log collection. When LTS prompts you that a new ICAgent version is available, perform the following operations to upgrade ICAgent in your Linux environment.

    Linux hosts support ICAgent upgrade on the LTS console, while Windows hosts do not.

    1. Log in to the management console and choose Management & Deployment > Log Tank Service.
    2. Choose Host Management > Hosts in the navigation pane.
    3. Click the Intra-Region Hosts or Extra-Region Hosts tab. When the system prompts you that a new ICAgent version is available, select one or more hosts where ICAgent is to be upgraded, and click Upgrade ICAgent.
    4. In the displayed dialog box, click OK.

      The ICAgent upgrade takes about 1 minute. When the ICAgent status changes from Updating to Running, the ICAgent upgrade has completed.

      If ICAgent is abnormal after the upgrade or if the upgrade fails, log in to the host and run the installation command to reinstall ICAgent. Uninstalling the original ICAgent is not required. For details, see Installing ICAgent (Intra-Region Hosts) and .

Container Scenario

  • Installing ICAgent in a CCE cluster
    1. Choose Host Management > Hosts in the navigation pane.
    2. Click the CCE Cluster tab. Select ICAgent Status in the search box to locate clusters whose ICAgent is in Uninstalled state, select one of the clusters, and click Upgrade ICAgent.
      • When a CCE cluster is created, ICAgent is installed on its hosts by default, with logs reported to LTS. The Output to AOM feature is disabled by default. If you enabled Output to AOM after cluster creation but want to revert to reporting logs to LTS, ensure Output to AOM is disabled before upgrading ICAgent. For Ingesting CCE Application Logs to LTS, you are advised to collect container standard output to LTS instead of AOM.
      • CCE cluster ID: Each cluster has a fixed ID.
      • When ICAgent is upgraded, LTS automatically creates a log group and host group for your CCE cluster, named k8s-log-{Cluster ID}. You can ingest logs of this CCE cluster to the log group when creating an ingestion configuration. For details, see Ingesting CCE Application Logs to LTS.
      • If the cluster's hosts do not have ICAgent installed or have an outdated version, clicking Upgrade ICAgent will install or upgrade ICAgent on all hosts in the cluster.
    3. In the displayed dialog box, click OK.

      The ICAgent upgrade takes about 1 minute. When the ICAgent status changes from Updating to Running, the ICAgent upgrade has completed.

  • Upgrading ICAgent in a CCE cluster follows the same process as installing it in a CCE cluster.

Uninstalling ICAgent

If ICAgent is uninstalled from a host, log collection will be affected. Exercise caution when performing this operation.

Uninstalling ICAgent does not delete the installation files. You need to delete them manually if necessary.

Uninstall ICAgent from a Linux environment using any of the following methods:

  • Uninstalling ICAgent on the console: applicable to uninstall ICAgent that has been successfully installed.
    1. Choose Host Management > Hosts in the navigation pane.
    2. Select one or more hosts where ICAgent is to be uninstalled and click Uninstall ICAgent.
    3. In the displayed dialog box, click OK.

      The uninstallation begins. This process takes about a minute.

      After the uninstallation is complete, the ICAgent status of the host will be displayed as Uninstalled in the host list.

      To reinstall ICAgent, wait for 5 minutes after it is uninstalled. Otherwise, the ICAgent may be automatically uninstalled again.

  • Logging in to the host to uninstall ICAgent: applies to the scenario where ICAgent fails to be installed.
    1. Log in to a host where ICAgent is to be uninstalled as user root.
    2. Run the following command:
      bash /opt/oss/servicemgr/ICAgent/bin/manual/uninstall.sh

      If the message "ICAgent uninstall success" is displayed, the uninstallation has completed.

  • Remotely uninstalling ICAgent: applicable to remotely uninstall ICAgent that has been successfully installed.

    You can uninstall ICAgent on one host remotely from another host.

    1. Run the following command on the host where ICAgent has been installed. x.x.x.x indicates the IP address of the host you want to uninstall ICAgent from.
      bash /opt/oss/servicemgr/ICAgent/bin/remoteUninstall/remote_uninstall.sh -ip x.x.x.x
    2. Enter the password for user root of the host when prompted.
      • If the Expect tool is installed on the host that has ICAgent installed, the ICAgent uninstallation should be able to complete without prompting you for a password. Otherwise, enter the password as prompted.
      • Ensure that user root can run SSH or SCP commands on the host where ICAgent has been installed to communicate with the remote host.
      • If the message "ICAgent uninstall success" is displayed, the uninstallation has completed.
  • Batch uninstalling ICAgent: applicable to uninstall ICAgent that has been successfully installed from a batch of hosts.

    If ICAgent has been installed on a host and the ICAgent installation package ICProbeAgent.tar.gz is in the /opt/ICAgent/ directory of the host, you can use this method to uninstall ICAgent from multiple hosts at once.

    The hosts must all belong to the same VPC and be on the same subnet.

    Prerequisites

    The IP addresses and passwords of all hosts to uninstall ICAgent have been collected, sorted in the iplist.cfg file, and uploaded to the /opt/ICAgent/ directory on the host that has ICAgent installed. Each IP address and password in the iplist.cfg file must be separated by a space. Examples:

    192.168.0.109 Password (Replace the IP address and password with the actual ones)

    192.168.0.39 Password (Replace the IP address and password with the actual ones)

    • The iplist.cfg file contains sensitive information. You are advised to clear it after using it.
    • If all hosts share a password, list only IP addresses in the iplist.cfg file and enter the password manually during execution. If one of the hosts uses a different password, type the password behind its IP address.
    1. Run the following command on the host that has ICAgent installed:
      bash /opt/oss/servicemgr/ICAgent/bin/remoteUninstall/remote_uninstall.sh -batchModeConfig /opt/ICAgent/iplist.cfg

      Enter the default password for user root of the hosts to uninstall ICAgent. If the passwords of all hosts have been configured in the iplist.cfg file, press Enter to skip this step.

      batch uninstall begin
      Please input default passwd:
      send cmd to 192.168.0.109
      send cmd to 192.168.0.39
      2 tasks running, please wait...
      End of uninstall agent: 192.168.0.109
      End of uninstall agent: 192.168.0.39
      All hosts uninstall icagent finish.

      If message "All hosts uninstall icagent finish." is displayed, the batch uninstallation has completed.

    2. Choose Host Management > Hosts in the navigation pane of the LTS console to check the ICAgent status.

Checking the ICAgent Status

To check the ICAgent status of a target host, choose Host Management > Hosts in the navigation pane. The following table lists the ICAgent statuses.

Table 1 ICAgent statuses

Status

Description

Running

ICAgent is running properly.

Uninstalled

ICAgent is not installed.

Installing

ICAgent is being installed. This process takes about 1 minute.

Installation failed

ICAgent installation failed.

Upgrading

ICAgent is being upgraded. This process takes about 1 minute.

Upgrade failed

ICAgent upgrade failed.

Offline

ICAgent is abnormal because the AK/SK is incorrect. Obtain the correct AK/SK and install ICAgent again.

Faulty

ICAgent is faulty. Contact technical support.

Uninstalling

ICAgent is being uninstalled. This process takes about 1 minute.

Authentication error

Authentication fails because parameters were incorrectly configured during ICAgent installation.