Modifies a site monitoring task.

Site monitoring supports the following protocols: HTTP, PING, TCP, UDP, DNS, SMTP, POP3, and FTP. Each protocol has a specific set of extended options specified by the OptionsJson parameter. The following tables describe the extended options supported for each protocol.

HTTP

Parameter

Type

Description

http_method

String

The request method. Valid values: GET, POST, and HEAD. Default value: GET.

header

String

The HTTP request header. The HTTP request header consists of key-value pairs. Separate the key-value pairs with newline characters ("\n"). Separate the key and value in each pair with a colon (:).

cookie

String

The HTTP cookie. Specify the HTTP cookie in compliance with the HTTP request standard.

request_content

String

The content of the request. The content can be in JSON or form format. If this parameter is not specified, the request has no body.

response_content

String

The expected or unexpected content of the response. The first 64 KB of the content returned from the HTTP server will be checked during site monitoring.

match_rule

String

The match rule.

The value 0 indicates that the detection is successful if the response does not contain the unexpected content specified by the response_content parameter.

The value 1 indicates that the detection is successful if the response contains the expected content specified by the response_content parameter.

username

String

The username used to authenticate the HTTP request. If this parameter is specified, the HTTP request will contain the basic authentication header.

password

String

The password used to authenticate the HTTP request.

time_out

Integer

The timeout period. Unit: milliseconds. Default: 5000.

max_redirect

Integer

The maximum number of redirections. The default value is 5 for a detection point provided by Alibaba Cloud and 2 for a detection point provided by a carrier. To disable redirections, set the value to 0. Valid values: 0 to 50.

PING

Parameter

Type

Description

failure_rate

Integer

The failure rate threshold. If the failure rate exceeds this value, the detection fails and the status code 610 (PingAllFail) or 615 (PingPartialFail) is returned. Default value: 0.1.

ping_num

Integer

The number of times that the monitored address is pinged. Valid values: 1 to 100. Default value: 20.

DNS

Parameter

Type

Description

dns_server

String

The domain name or IP address of the Domain Name System (DNS) server.

dns_type

String

The type of DNS records to query. Valid values: A, NS, CNAME, MX, TXT, and ANY.

expect_value

String

The expected value list, consisting of the IP addresses to be obtained after DNS resolution. Separate IP addresses with space characters.

match_rule

String

The relationship between the expected value list and the returned value list after DNS resolution. If the two lists do not meet the specified relationship, the detection fails. Valid values:

Empty string or IN_DNS: The expected value list is a subset of the returned value list.

DNS_IN: The returned value list is a subset of the expected value list.

EQUAL: The returned value list is the same as the expected value list.

ANY: the returned value list intersects with the expected value list.

FTP

Parameter

Type

Description

port

Integer

The port number of the FTP server. If this parameter is not specified, the default port number is used. The default port number is 21 for FTP and 990 for FTPS.

username

String

The username used to log on to the FTP server. If this parameter is not specified, anonymous logon is used.

password

String

The password used to log on to the FTP server.

POP3 or SMTP

Parameter

Type

Description

port

Integer

The port number of the POP3 server. The default port number is 110 for the POP3 protocol and 995 for the POP3S protocol.

username

String

The username used to log on to the server.

password

String

The password used to log on to the server.

TCP or UDP

Parameter

Type

Description

port

Integer

The TCP or UDP port to monitor.

request_content

String

The content of the request. If the request_format parameter is set to hex, the value of the request_content parameter must be in hexadecimal format.

request_format

String

The format of the request content. If the request_format parameter is not set to hex, the value of the request_content parameter will be sent to the server as common text.

response_content

String

The expected or unexpected content of the response. If the response from the server does not contain the expected content specified by the response_content parameter, the detection fails.

If the response_format parameter is set to hex, the value of the response_content parameter must be in hexadecimal format.

If the response_format parameter is not set to hex, the server considers the value of the response_content parameter as common text.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ModifySiteMonitor

The operation that you want to perform. Set the value to ModifySiteMonitor.

TaskId String Yes 49f7b317-7645-4cc9-94fd-ea42e522****

The ID of the site monitoring task.

Address String No http://www.aliyun.com

The URL or IP address monitored by the site monitoring task.

TaskName String No Website monitoring modification

The name of the site monitoring task. The name can be 4 to 100 characters in length. It can contain letters, digits, and underscores (_).

Interval String No 1

The interval at which detection requests are sent.

Valid values: 1, 5, and 15. Unit: minutes. Default value: 1.

IspCities String No [{"city":"546","isp":"465"},{"city":"572","isp":"465"},{"city":"738","isp":"465"}]

The information about detection points, which is specified in a JSON array. Example: [{"city":"546","isp":"465"},{"city":"572","isp":"465"},{"city":"738","isp":"465"}].

The three city codes respectively represent Beijing, Hangzhou, and Qingdao.

You can call the DescribeSiteMonitorISPCityList operation to query the detection points that are available for creating site monitoring tasks. If this parameter is not specified, the system randomly select three detection points for site monitoring.

OptionsJson String No {"time_out":5000}

The extended options of the protocol used by the site monitoring task. The options vary based on the protocol.

AlertIds String No 49f7c317-7645-4cc9-94fd-ea42e122****

The ID of the existing alert rule to be associated with the site monitoring task.

Response parameters

Parameter Type Example Description
Code String 200

The HTTP status code.

Note The status code 200 indicates that the call was successful.
Data Struct

The result of modifying the site monitoring task.

count Integer 1

The number of the site monitoring tasks that were modified.

Message String Successfully

The returned message.

RequestId String 68192f5d-0d45-4b98-9724-892813f86c71

The ID of the request.

Success String true

Indicates whether the call was successful. The value true indicates a success. The value false indicates a failure.

Examples

Sample requests

http(s)://[Endpoint]/? Action=ModifySiteMonitor
&TaskId=49f7b317-7645-4cc9-94fd-ea42e522****
&<Common request parameters>

Sample success responses

XML format

<ModifySiteMonitor>
      <Data>
            <count>1</count>
      </Data>
      <Message>Successfully</Message>
      <RequestId>B6593DD0-73E6-48EF-8019-ED4687ED378D</RequestId>
      <Success>true</Success>
      <Code>200</Code>
</ModifySiteMonitor>

JSON format

{
  "Data": {
    "count": 1
  },
  "Message":"Successfully",
  "RequestId":"B6593DD0-73E6-48EF-8019-ED4687ED378D",
  "Success": true,
  "Code": "200"
}

Error codes

For a list of error codes, visit the API Error Center.