You can create a site monitoring task to monitor sites on the Internet and analyze network quality or performance.

Prerequisites

  • Alert contacts and alert groups are created if you need to configure alert rules for a site monitoring task. When you configure an alert rule, you can select an alert group as the alert notification recipient. For more information, see Create an alert contact or alert group.
  • A callback URL that can be accessed over the Internet is prepared if you need to enable the alert callback feature for alert rules. In addition, URL callback is enabled as an alert notification method in your existing O&M or notification system.

Background information

Site monitoring sends detection requests that simulate real user access from Alibaba Cloud data centers to your site to test and monitor access to your site. Site monitoring is applicable to the following scenarios:

  • Create a site monitoring task to obtain the information about the destination site, such as the time consumed to resolve the domain name to an IP address, establish the connection, receive the first packet, and download data. The information can help you analyze the performance bottlenecks of your service.
  • Monitor the sites of Alibaba Cloud and carriers at the same time by using the selected detection points. You can compare the quality of Alibaba Cloud services with that of the services provided by the carriers based on the monitoring results.
  • Send detection requests from all Alibaba Cloud regions.

Procedure

  1. Log on to the CloudMonitor console.
  2. In the left-side navigation pane, click SiteMonitor.
  3. On the Monitoring task tab, click Create task.
  4. In the Task settings step of the New Task panel, select a protocol and configure the basic information of the protocol.
    Parameter Description
    Monitor Type The protocol used by the site monitoring task. Valid values: HTTP(S), PING, TCP, UDP, DNS, SMTP, POP3, and FTP.
    Task Name The name of the site monitoring task. The value must be 4 to 100 characters in length. It can contain letters, digits, and underscores (_).
    IP Probe Type The IP address type used by the site monitoring task. Valid values: IPV4 and IPV6.
    Monitor Domain Name The address of the monitored site. Valid values:
    • Enter the task address manually: Enter the address of the monitored site. You can enter multiple addresses at a time. Each address occupies a line. After you save the configurations, CloudMonitor generates a site monitoring task for each site address that is specified.
    • Import from Cloud Resolution Domain Name: Select the domain name of the monitored site from Alibaba Cloud DNS. For more information about how to create a DNS domain name, see Add a record to a website domain.
    Frequency The frequency of the site monitoring task. Valid values: 1Minute, 5Minute, 15Minute, 30Minute, and 60Minute. For example, if you select 1Minute, a detection point in a region sends a detection request to the monitored site every minute.
    Advanced settings The advanced settings for the selected protocol. For more information about the advanced settings supported by different protocols, see Description.
  5. Click Next.
  6. In the Select detection point step, select the detection points to be used.
    Note If the default detection points cannot meet your requirements, perform the following steps to create custom detection points.
    1. Click the Edit icon to the right of Custom probe point selection.
    2. Click Create Template.
    3. Enter the custom template name in the Template Name field and select custom detection points.
    4. Click OK.
    5. Click OK.
  7. Click Next.
  8. In the Set alarm step, add alert rules and configure advanced settings for the alert rules.
    1. Optional. Add an alert rule.
      Note CloudMonitor provides two default alert rules. If the default rules cannot meet your requirements, perform the following steps to add an alert rule.
      1. Click Add Rule Description.
      2. Set the required parameters to add an alert rule.
        Parameter Description
        Rule Name The name of the alert rule.
        Metric Name The name of the metric related to the alert rule. Valid values:
        • Percentage of available probe points

          Value of the Percentage of available probe points metric = Value of the Number of available probe points metric/Total number of detection requests × 100

        • Number of available probe points

          The value is the number of times that the domain name or IP address of the site can be accessed as expected in a monitoring period.

        • Any Status Code (Independent Alert)
        • All status code (independent alert)
        • ResponseTime
        Comparison The comparison operator used in the alert rule. Valid values:
        • >=
        • >
        • <=
        • <
        • =
        • !=
        • Compare With Yesterday Rise
        • Compare With Yesterday Decline
        • Compare With Last Week Rise
        • Compare With Last Week Decline
        • Compare With Last Period Rise
        • Compare With Last Period Decline
        Threshold and Alert Level The alert level and the corresponding threshold.

        Valid values of the alert level: Critical, Warn, and Info.

        Valid values of the number of consecutive periods in which the metric value exceeds the threshold before an alert is triggered: 1, 2, 3, 4, 5, 10, 15, and 20.

      3. Click OK.
    2. Click Advanced settings to configure advanced settings for the alert rules.
      Parameter Description
      Notify contact The alert group to which alert notifications are sent.
      Channel silence cycle The interval of resending the notification for an alert before the alert is cleared.

      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 period during which the alert rules are effective. CloudMonitor monitors the metrics and generates alerts only if the alert rules are effective.
      Alarm callback The callback URL that can be accessed over the Internet. CloudMonitor sends a POST request to push an alert to the specified callback URL. Only HTTP requests are supported. For more information about how to configure alert callbacks, see Use the alert callback feature to report threshold-triggered alerts.
  9. Click Finish.

Description

The following tables describe the advanced settings for different protocols.
  • HTTP or HTTPS
    Parameter Setting method Required Description
    Monitor Domain Name URL or domain name Yes
    • If the HTTPS protocol is used, the URL must contain the https scheme. Example: https://aliyun.com.
    • If you enter a URL that does not have a scheme, the default scheme http is added to the URL.
    Request Method Option button Yes
    The HTTP request method. Valid values:
    • GET (default value)
    • POST
    • HEAD
    Request content Form data or JSON objects No The request content can contain multiple key-value pairs in the key1=value1;key2=value2 format or a JSON string in the {"test":"testValue"} format.
    Note This parameter is required if you set the Request Method parameter to POST.
    Match response method Option button Yes
    If you specify the response content to match, site monitoring checks whether the first 64 KB of the response body contains the response content to match. Valid values:
    • Alert if the matching content is included.
    • Alert if the matching content not included.

    Site monitoring determines whether to generate an alert based on the mode in which the response is matched.

    The matching content must be in English.

    Match response content Text No
    HTTP request header Multiple lines of text No
    An HTTP header is a key-value pair in which the key and value are separated by a colon (:). Each HTTP header occupies a line. Site monitoring adds the following preset headers to the request:
    • Host:${Domain name in the monitored address}
    • Pragma:no-cache
    • Cache-Control:no-cache
    • User-Agent:Chrome/57
    • Accept: */*

    If the request body is a form, the request also contains the following header:

    Content-Type: application/x-www-form-urlencoded;charset=UTF-8

    If your request contains one or more of the preceding headers, the headers are overwritten by your settings.

    Note Site monitoring converts the keys that you specify in the request headers to the canonical format of MIME headers based on the following rules of the HTTP protocol:
    • The first letter and the letter that follows a hyphen (-) are converted to uppercase letters. For example, accept-encoding is converted to Accept-Encoding.
    • If a key contains a space or invalid characters, the key remains unchanged.
    Acceptable additional HTTP status codes Text No An HTTP status code greater than or equal to 400. Separate multiple status codes with commas (,).
    Cookie Cookie text No The HTTP cookie.
    HTTP Authentication Username Username No The username and password that are used for basic HTTP authentication.
    HTTP Authentication Password Password No
    Certificate verification Check box No Specifies whether server name indication (SNI) is supported. By default, the check box is cleared, which indicates that SNI is not supported.
    Unfollow Redirect Check box No Specifies whether to follow redirects if the status code 301 or 302 is returned. By default, the check box is cleared, which indicates that redirects are followed.
    Whether to turn on ProxyProtocol Check box No By default, the check box is cleared, which indicates that the proxy protocol is not supported.
  • PING
    Parameter Setting method Required Description
    Monitor Domain Name URL or domain name Yes N/A
    Number of ping packets Positive integer Yes The number of times that the site is pinged. Default value: 20. Valid values: 1 to 40.
  • TCP or UDP
    Parameter Setting method Required Description
    Monitor Domain Name URL or domain name Yes N/A
    port Positive integer Yes The TCP or UDP port.
    Request Format Option button Yes This parameter takes effect only when the Request content parameter is set. Valid values:
    • Text
    • Hexadecimal Format
    Request content Common text or hexadecimal format No
    • Common text
      Common text refers to strings that consist of printable characters.
      Note Common text does not support escaping. For example, \n is considered as two characters (\ and n) rather than the newline character.
    • Hexadecimal format

      If the request content is a byte string that cannot be presented in printable characters, you can convert the byte string to a hexadecimal string that consists of printable characters. Conversion rules: A byte is converted to two hexadecimal characters. For example, (byte)1 is converted to 01, and (byte)27 is converted to 1B.

      Binary array in the Java format: {(byte)1, (byte)27} is converted to 011b or 011B. Hexadecimal characters are not case-sensitive in site monitoring. Enter "011B" in the Request content field and set the Request Format parameter to Hexadecimal Format.

    Matching Content Format Option button Yes This parameter takes effect only when the Content Match parameter is set. Valid values:
    • Text
    • Hexadecimal Format
    Content Match Common text or hexadecimal format No
    • Common text
      Common text refers to strings that consist of printable characters.
      Note Common text does not support escaping. For example, \n is considered as two characters (\ and n) rather than the newline character.
    • Hexadecimal format

      If the request content is a byte string that cannot be presented in printable characters, you can convert the byte string to a hexadecimal string that consists of printable characters. Conversion rules: A byte is converted to two hexadecimal characters. For example, (byte)1 is converted to 01, and (byte)27 is converted to 1B.

      Binary array in the Java format: {(byte)1, (byte)27} is converted to 011b or 011B. Hexadecimal characters are not case-sensitive in site monitoring. Enter "011B" in the Request content field and set the Request Format parameter to Hexadecimal Format.

  • DNS
    Parameter Setting method Required Description
    Monitor Domain Name URL or domain name Yes N/A
    Type Option button Yes The type of DNS records to query.

    Valid values: A, MX, NS, CNAME, TXT, and ANY.

    DNS Server Domain name or IP address of the server No If you do not set this parameter, the default DNS server address of the detection point is used. You can enter a domain name or an IP address.
    Expected to resolve IP address or domain Multiple lines of text No

    CloudMonitor checks whether the DNS resolution result contains the expected domain names or IP addresses. The detection is considered successful if the list of expected values is a subset of the list of DNS results.

    Separate multiple domain names or IP addresses with commas (,).

    Match Rule An option from the drop-down list Yes The matching rule for the domain name or IP address.
  • SMTP
    Parameter Setting method Required Description
    Monitor Domain Name URL or domain name Yes N/A
    port Positive integer Yes The SMTP port.
    username Text Yes

    The username and password that are used for PLAIN authentication.

    Make sure that the specified username and password are correct. Site monitoring sends detection requests at the frequency that you specify. If the username or password is wrong, your account may be blocked by the destination service due to frequent logon failures.

    Password Text Yes
    secure connection Option button Yes Specifies whether to use Secure Sockets Layer (SSL) for the SMTP connection. Valid values:
    • Use
    • Not Use
  • POP3
    Parameter Setting method Required Description
    Monitor Domain Name URL or domain name Yes N/A
    port Positive integer Yes The POP3 port.
    username Text Yes

    The username and password that are used for authentication.

    Make sure that the specified username and password are correct. Site monitoring sends detection requests at the frequency that you specify. If the username or password is wrong, your account may be blocked by the destination service due to frequent logon failures.

    Password Text Yes
    secure connection Option button Yes Specifies whether to use SSL for the POP3 connection. Valid values:
    • Use
    • Not Use
  • FTP
    Parameter Setting method Required Description
    Monitor Domain Name URL or domain name Yes Example: ftp://smtp.aliyun.com.
    port Positive integer Yes The FTP port.
    Are you anonymous login Option button Yes
    • Anonymous Logon (default value)
    • Authentication Required

      If you select this value, you must specify the username and password of the FTP server.

    Username Text Yes

    The username and password of the FTP server.

    Password Text Yes