CreateSiteMonitor
Region:
China (Beijing)
Request Parameters
Required
AddressThe URL or IP addre...
TaskTypeThe protocol that i...
TaskNameThe name of the sit...
IntervalThe interval at whi...
IspCitiesThe information of ...
OptionsJsonThe extended option...
AlertIdsThe ID of the alert...
CustomScheduleThe custom detectio...
VpcConfig
Plugin DownloadLearn more
VS Code Plugin
Before installing the plugin, please install VS CodeBefore installing the plugin, please install VS Code
Alibaba Cloud Developer Toolkit is a collection of extensions that can help access Alibaba Cloud services in Visual Studio Code.
JetBrains Plugin
Before installing the plugin, please install JetBrains IDEBefore installing the plugin, please install JetBrains IDE
The Alibaba Cloud Developer Toolkit for JetBrains makes it easier to access Alibaba Cloud services.

Operation Description

This topic provides an example on how to create a site monitoring task named HanZhou_ECS1. The URL that is monitored by the task is https://www.aliyun.com and the type of the task is HTTPS.

Request Parameters

Field NameField Details
Addressstring

The URL or IP address that is monitored by the task.

Example:https://www.aliyun.com
TaskTypestring

The protocol that is used by the site monitoring task.View Details...

Example:HTTPS
TaskNamestring

The name of the site monitoring task.View Details...

Example:HanZhou_ECS1
Intervalstring

The interval at which detection requests are sent.View Details...

Example:1
IspCitiesstring

The information of the detection points. If you leave this parameter empty, the system randomly selects three detection points.View Details...

Example:[{"city":"546","isp":"465"},{"city":"572","isp":"465"},{"city":"738","isp":"465"}]
OptionsJsonstring

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

Example:{"time_out":5000}
AlertIdsstring

The ID of the alert rule.View Details...

Example:SystemDefault_acs_ecs_dashboard_InternetOutRate_Percent
CustomSchedulestring

The custom detection period. You can only select a time period from Monday to Sunday for detection.

Example:{"start_hour":0,"end_hour":24, "days":[0], "time_zone":"Local"}
VpcConfigstring

Request Description

The following tables describe the extended options of the HTTP, HTTPS, PING, TCP, UDP, DNS, WEBSOCKET, SMTP, POP3, and FTP protocols specified by the TaskType parameter.

  • HTTP or HTTPS
ParameterTypeDescription
http_methodStringThe HTTP or HTTPS request method. Valid values: GET, POST, and HEAD. Default value: GET.
headerStringThe custom HTTP headers that are separated by line feeds (\n).Each header must comply with the HTTP protocol. Each header must be a key-value pair in which the key and value are separated by a colon (:).
cookieStringThe HTTP cookie that is specified in compliance with the HTTP request standard.
request_contentStringThe content of the request. The content can be in the JSON or form format. If this parameter is not specified, the request body is empty.
response_contentStringThe expected content of the response. The first 64 bytes of the content returned by the HTTP server are checked during site monitoring.
match_ruleString0: The detection is successful if the response does not contain the content specified by the response_content parameter.1: The detection is successful if the response contains the content specified by the response_content parameter.
usernameStringIf the username parameter is specified, the HTTP request contains the basic authentication header.
passwordStringThe password that is used to authenticate the HTTP or HTTPS request.
time_outintThe timeout period. Unit: milliseconds. Default value: 5.
max_redirectintThe maximum number of redirections. The default value is 5 for a detection point that is running on an Elastic Compute Service (ECS) instance and 2 for a detection point that is provided by a carrier.To disable redirections, set the value to 0.Valid values: 0 to 50.
  • PING
ParameterTypeDescription
failure_rateTextIf the rate of the failed pings exceeds the value of this parameter, the detection fails and the status code 610 or 615 is returned. The error message of the status code 610 is PingAllFail and the error message of the status code 615 is PingPartialFail.Default value: 0.1.
ping_numintThe number of times that the monitored address is pinged. Default value: 10.Valid values: 1 to 100.
  • DNS
ParameterTypeDescription
dns_serverstringThe domain name or IP address of the Domain Name System (DNS) server.
dns_typestringThe type of the DNS records to query. Valid values: A, NS, CNAME, MX, TXT, ANY, and AAAA.
expect_valuestringThe list of expected values. Separate the expected values with space characters.
match_rulestringThe relationship between the list of expected values and the list of DNS results. If the two lists do not meet the specified relationship, the detection fails. Valid values:Empty string or IN_DNS: The list of expected values is a subset of the list of DNS results.DNS_IN: The list of DNS results is a subset of the list of expected values.EQUAL: The list of DNS results is the same as the list of expected values.ANY: The list of DNS results intersects with the list of expected values.
  • FTP
ParameterTypeDescription
portintThe port number of the FTP server. If this parameter is not specified, the default value is used. The default port number is 21 for FTP and 990 for FTPS.
usernamestringThe username that is used to log on to the FTP server. If this parameter is not specified, anonymous logon is used.
passwordstringThe password that is used to log on to the FTP server.
  • POP3 or SMTP
ParameterTypeDescription
portintThe port number of the POP3 or SMTP server. The default port number is 110 for POP3, 995 for POP3S, and 25 for SMTP.
usernamestringThe username that is used to log on to the POP3 or SMTP server. The username and password that are used to log on to the POP3 or SMTP server are required.
passwordstringThe password that is used to log on to the POP3 or SMTP server. The username and password that are used to log on to the POP3 or SMTP server are required.
  • TCP or UDP
ParameterTypeDescription
portintThe port number of the TCP or UDP server.
request_contentstringThe content of the request. If the request_format parameter is set to hex, the value of the request_content parameter is parsed in the hexadecimal format.
request_formatstringIf the request_format parameter is set to another value, the value of the request_content parameter is sent to the TCP or UDP server as a regular string.
response_contentstringThe content of the response. If the response from the TCP or UDP server does not contain the 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 is parsed in the hexadecimal format.If the response_format parameter is set to another value, the value of the response_content parameter is parsed as a regular string.
  • WEBSOCKET
ParameterTypeDescription
request_contentstringThe message content.
empty_messagebooleanAllows the server to return no message or an empty string.

Response Parameters

Field NameField Details
Codestring

The HTTP status code.View Details...

Example:200
Messagestring

The returned message.

Example:Successful
RequestIdstring

The request ID.

Example:68192f5d-0d45-4b98-9724-892813f86c71
Successstring

Indicates whether the request was successful. Valid values:View Details...

Example:true
Dataobject

The result of the site monitoring task.

CreateResultListobject
Change History
No Change History found.