This topic describes how to use CloudMonitor to monitor the availability of services in a virtual private cloud (VPC).

Background information

As an increasing number of users migrate their services from the classic network to VPCs that are safer and more reliable, users need to monitor the availability of services in VPCs. This topic describes how to monitor the availability of services in a VPC, including Elastic Compute Service (ECS), ApsaraDB RDS, ApsaraDB for Redis, and Server Load Balancer (SLB).

Before you begin

The following figure shows how to monitor the availability of services in a VPC. Monitor the availability of services in a VPC

Before you can monitor the availability of services in a VPC, you must install the CloudMonitor agent on the ECS instances that will be used as monitoring nodes. To monitor the availability of a service in a VPC, create an availability monitoring task in the CloudMonitor console, select a monitoring node, and specify the URL or port of the monitored target. After the availability monitoring task is created, the CloudMonitor agent on the monitoring node sends an HTTP request or a Telnet request to the URL or port every minute. The CloudMonitor agent collects the response time and status codes and reports the monitoring results to CloudMonitor. CloudMonitor displays the monitoring results in a chart and generates alerts if the connection times out or the monitoring fails.

Procedure

Note
  • You must install the CloudMonitor agent on the ECS instances that will be used as monitoring nodes.
  • You must create an application group and add the monitoring nodes to the group.
  1. Log on to the CloudMonitor console.
  2. In the left-side navigation pane, click Application Groups.
  3. On the Application Groups tab, click the name of the application group.
  4. In the left-side navigation pane, click Availability Monitoring.
  5. Click Add Availability Monitoring.
  6. In the Create Task step on the Create/Modify Availability Monitoring panel, set the parameters based on your needs.
    Parameter Description
    Task Name The name of the availability monitoring task.
    Monitoring Nodes The IDs of the instances that you want to monitor.
    Monitored Target The object that you want to monitor. Valid values:
    • URL or IP Address: Select this option only when you need to monitor ECS instances.
    • ApsaraDB RDS: Select this option only when you need to monitor ApsaraDB RDS instances.
    • ApsaraDB for Redis: Select this option only when you need to monitor ApsaraDB for Redis instances.
    Detection Type The method that you want to use to monitor the object.
    If you set the Monitored Target parameter to URL or IP Address, you can select one of the following methods:
    • HTTP(S): If you select this option, enter the URL of the object that you want to monitor.
    • TELNET: If you select this option, enter the IP address of the object that you want to monitor.
    • PING: If you select this option, enter the IP address of the object that you want to monitor.
    If you set the Monitored Target parameter to ApsaraDB RDS or ApsaraDB for Redis, you can select one of the following methods:
    • TELNET: If you select this option, enter the instance ID and connection URL of the object that you want to monitor.
    • PING: If you select this option, enter the instance ID and connection URL of the object that you want to monitor.
    Request Method The request method. Valid values: HEAD, GET, and POST.
    Note This parameter is required if you set the Monitored Target parameter to URL or IP Address and the Detection Type parameter to HTTP(S).
    Monitoring Frequency The interval at which detection requests are sent.

    Valid values: 15 Seconds, 30 Seconds, 1 Minutes, 2 Minutes, 5 Minutes, 15 Minutes, 30 Minutes, and 60 Minutes. For example, if you select 1 Minutes, CloudMonitor sends a detection request to the monitored object every minute.

    Note This parameter is required if you set the Monitored Target parameter to URL or IP Address and the Detection Type parameter to HTTP(S).
    Headers The HTTP or HTTPS headers of detection requests for site monitoring.

    A header must be in the parameter1:value1 format.

    Separate multiple headers with commas (,).

    Note This parameter is required if you set the Monitored Target parameter to URL or IP Address and the Detection Type parameter to HTTP(S).
    POST Content The content of POST requests for site monitoring.

    The content must be in the parameter1=value1&parameter2=value2 format and must be English.

    Note This parameter is required if you set the Monitored Target parameter to URL or IP Address, the Detection Type parameter to HTTP(S), and the Request Method parameter to POST.
    Match Response Content The response content that you want to match and the method used to match the response content.
    If you specify response content, the monitoring task checks whether the first 64 KB of the HTTP response body contains the response content that you specify. Valid values:
    • Generate Alerts If Response Contains
    • Generate Alerts If Response Does Not Contain
    Note This parameter is required if you set the Monitored Target parameter to URL or IP Address and the Detection Type parameter to HTTP(S).
    Note
    • To monitor whether local processes on ECS instances in a VPC respond, select the ECS instances to be monitored in the Monitoring Nodes section, set the Monitored Target parameter to URL or IP Address, and enter the addresses in localhost:port/path format in the Detection Type section.
    • To monitor whether an SLB instance in a VPC responds, select an ECS instance that resides in the same VPC as the SLB instance in the Monitoring Nodes section, set the Monitored Target parameter to URL or IP Address, and enter the address of the SLB instance in the Detection Type section.
    • To monitor whether an ApsaraDB RDS or ApsaraDB for Redis instance in a VPC responds to an ECS instance, add the ApsaraDB RDS or ApsaraDB for Redis instance to the application group of the ECS instance, select the ECS instance in the Monitoring Nodes section, and set the Monitored Target parameter to ApsaraDB RDS or ApsaraDB for Redis.
  7. Click Next.
  8. In the Configure Alert Rule step, set the parameters.
    Parameter Description
    Status Code

    If the status code reaches the specified value, an alert is triggered.

    An alert is triggered regardless of which value of the Status Code parameter or the Response Time parameter reaches the threshold. CloudMonitor sends alert notifications to the alert contact group of the application group.

    Response Time

    If the response time reaches the specified value, an alert is triggered.

    If the value of the Status Code parameter or the Response Time parameter meets the threshold value, an alert is triggered. CloudMonitor sends alert notifications to the alert group of a specified application group.

    Notification Methods The methods that are used to send alert notifications. Valid values:

    Info (Email + DingTalk)

    Alert Callback The URL that is used to receive the alert notifications sent from CloudMonitor by using HTTP POST requests. The URL must be accessible over the Internet. You can enter only an HTTP URL. For more information about how to set callback URLs, see Use the alert callback feature to send notifications about threshold-triggered alerts.
    Mute for The interval at which CloudMonitor sends alert notifications until the alert that is triggered based on the alert rule is cleared. Valid values: 5 Minutes, 15 Minutes, 30 Minutes, 60 Minutes, 3 Hours, 6 Hours, 12 Hours, and 24 Hours.

    An alert is triggered when the conditions of an alert rule are met. CloudMonitor does not resend an alert notification when the alert is triggered again within the mute period. CloudMonitor starts to resend alert notifications if the alert is not cleared after the mute period ends.

    Effective Time The validity period of the alert rule. The system sends alert notifications only within the validity period of an alert rule and records events when the validity period expires.
  9. Click OK.
  10. Find the monitoring task and click Chart in the Actions column.
    You can view the monitoring details in the monitoring charts. Monitoring chart