Help Center/ Auto Scaling/ FAQs/ AS Policy/ How Do I Install the Agent on Instances in an AS Group to Use Agent Monitoring Metrics?
Updated on 2022-09-22 GMT+08:00

How Do I Install the Agent on Instances in an AS Group to Use Agent Monitoring Metrics?

Scenarios

If an AS group uses an alarm-based scaling policy, you can install the Agent on the instances to better monitor the AS group. Compared with basic monitoring, Agent monitoring (OS monitoring) provides proactive, fine-grained, system-level monitoring of instances. This section describes how to install the Agent on instances.

Procedure

  1. Log in to the management console and click Elastic Cloud Server under Compute.

    The Elastic Cloud Server page is displayed.

  2. Create an ECS and install the Agent.

    For more information, see Agent Installation and Configuration.

  3. After installing the Agent plug-in, log in to the Cloud Eye console, choose Server Monitoring > Elastic Cloud Server, and ensure that the Agent is running and collecting the monitoring metrics.
    Figure 1 Checking the Agent status
    Figure 2 Viewing Agent monitoring metrics
  4. Add the AK/SK pair to the conf.json configuration file of the ECS.
    1. Click your username, choose My Credentials > Access Keys, and obtain the AK/SK pair.
      • If you have created an access key, obtain the AccessKey value and the SecretKey value in the credentials.csv file you obtained when you create the access key.
      • If no access keys are available, click Create Access Key to create one. Save the credentials.csv file and obtain the AccessKey value and the SecretKey value in it.
    2. Log in to the ECS and use cd /usr/local/telescope/bin to go to the Agent installation directory.
    3. Run vi conf.json to open the configuration file and enter the obtained AK/SK pair.

      If the Agent was installed during ECS creation, the AK/SK pair was added during user data injection. You only need to check the AK/SK pair in this step.

    4. Press Esc and enter :wq to save the configuration and exit.
  5. Go to the Image Management Service page and create a private image ces-agent-test for this ECS. For details, see Creating a Private Image.
    Figure 3 Creating a private image
  6. Go to the Auto Scaling page and use the private image created in step 5 to create an AS configuration.
    Figure 4 Selecting the private image

    Click Private image for Image, select ces-agent-test from the drop-down list, and set other parameters as required.

  7. Use the AS configuration created in step 6 to create an AS group.
  8. Add an AS policy for the AS group. Set Policy Type to Alarm and Trigger Condition to an Agent monitoring metric, such as (Agent) Memory Usage.
    Figure 5 Selecting a trigger condition
  9. Manually add the ECS created in step 2 to the AS group.
  10. Perform the following operations to check whether the Agent monitoring has taken effect:
    • Verify that the Agent monitoring metric is displayed on the Monitoring tab of the AS group details page.
    • When the alarm threshold is reached, verify that the alarm policy has triggered scaling actions and instance are added or removed.
    • The Agent monitoring data is collected from all instances that are automatically added to the AS group.