Queries the details of a site monitoring task.

This topic provides an example on how to query the details of a site monitoring task whose ID is cc641dff-c19d-45f3-ad0a-818a0c4f****. The returned result indicates that the task name is test123, the address that is monitored by the task is https://aliyun.com, and the name of the carrier is Alibaba.

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 DescribeSiteMonitorAttribute

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

TaskId String Yes cc641dff-c19d-45f3-ad0a-818a0c4f****

The ID of the site monitoring task.

IncludeAlert Boolean No false

Specifies whether to return the information of the alert rules that are configured for the site monitoring task. Valid values:

  • true: The system returns the information of the alert rules that are configured for the site monitoring task.
  • false: The system does not return the information of the alert rules that are configured for the site monitoring task. Default value: false.

For more information about common request parameters, see Common parameters.

Response parameters

Parameter Type Example Description
RequestId String D17DF650-7EBD-54D0-903A-1D4E624D7402

The ID of the request.

Code String 200

The HTTP status code.

Note The status code 200 indicates that the call was successful.
Success Boolean true

Indicates whether the call was successful. Valid values:

  • true: The call was successful.
  • false: The call failed.
SiteMonitors Struct

The details of the site monitoring task.

Address String https://aliyun.com

The address that is monitored by the site monitoring task.

Interval String 1

The interval at which the site monitoring task is executed. Unit: minutes. Valid values: 1, 5, 15, 30, and 60.

IspCities Array of IspCity

The information of detection points. The information includes the carriers that provide the detection points and the cities where the detection points reside.

IspCity
City String 738

The ID of the city.

CityName String Beijing

The name of the city.

Isp String 465

The ID of the carrier.

IspName String Alibaba

The name of the carrier.

OptionJson Struct

The extended options of the site monitoring task. The options vary based on the specified protocol. For more information, see CreateSiteMonitor.

attempts Long 3

The number of retries after a DNS failure occurred.

authentication Integer 1

Indicates whether the security authentication feature is enabled. Valid values:

  • 0: The security authentication feature is disabled.
  • 1: The security authentication feature is enabled.
cookie String lang=en

The cookie of the HTTP request.

dns_match_rule String IN_DNS

The relationship between the list of expected aliases or IP addresses and the list of DNS results. Valid values:

  • 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.
dns_server String 192.168.XX.XX

The IP address of the DNS server.

Note This parameter is returned only if the TaskType parameter is set to DNS.
dns_type String A

The type of the DNS record. This parameter is returned only if the TaskType parameter is set to DNS. Valid values:

  • A: The default name. This value indicates a record that specifies an IP address related to the specified host name or domain name.
  • CNAME: a record that maps multiple domain names to a domain name.
  • NS: a record that specifies a DNS server used to parse domain names.
  • MX: a record that links domain names to the address of a mail server.
  • TXT: a record that stores the text information of host name or domain names. The text must be 1 to 512 bytes in length. The TXT record serves as a Sender Policy Framework (SPF) record to fight against spam.
expect_value String dns_server

The domain name or alias to be parsed.

Note This parameter is returned only if the TaskType parameter is set to DNS.
failure_rate Float 0.4

The packet loss rate.

Note This parameter is returned only if the TaskType parameter is set to PING.
header String testKey:testValue

The header of the HTTP request.

http_method String get

The HTTP request method. Valid values:

  • get
  • post
  • head
isBase64Encode String true

Indicates whether the value of the password parameter is encoded in Base64.

  • true: The value of the password parameter is encoded in Base64.
  • false: The value of the password parameter is not encoded in Base64.
match_rule Integer 1

Indicates whether the alert rule is included. Valid values:

  • 0: The alert rule is included.
  • 1: The alert rule is not included.
password String 123****

The password of the SMTP, POP3, or FTP protocol.

ping_num Integer 29

The heartbeat of the PING protocol.

port Integer 110

The port number of the TCP, UDP, SMTP, or POP3 protocol.

protocol String TCP

The protocol that is used to send the request.

request_content String aa=bb

The content of the HTTP request.

request_format String txt

The format of the HTTP request. Valid values:

  • hex: hexadecimal
  • txt: text
response_content String txt

The response to the HTTP request.

response_format String txt

The format of the response. Valid values:

  • hex: hexadecimal
  • txt: text
time_out Long 3

The timeout period. Unit: milliseconds.

username String testUser

The username of the FTP, SMTP, or POP3 protocol.

TaskId String cc641dff-c19d-45f3-ad0a-818a0c4f****

The ID of the site monitoring task.

TaskName String test123

The name of the site monitoring task.

TaskState String 1

The status of the site monitoring task. Valid values:

  • 1: The task is enabled.
  • 2: The task is disabled.
TaskType String HTTP

The protocol that is used by the site monitoring task. Valid values: HTTP, HTTPS, PING, TCP, UDP, DNS, SMTP, POP3, and FTP.

MetricRules Array of MetricRule

The information of the alert rules that are configured for the site monitoring task.

MetricRule
ActionEnable String true

Indicates whether the alert rule is enabled. Valid values:

  • true: The alert rule is enabled.
  • false: The alert rule is disabled.
AlarmActions String CloudMonitor

The alert contact group to which alert notifications are sent.

ComparisonOperator String GreaterThanYesterday

The comparison operator that is used in the alert rule. Valid values:

  • >=
  • >
  • <=
  • <
  • =
  • !=
  • GreaterThanYesterday: greater than the metric value at the same time yesterday
  • LessThanYesterday: less than the metric value at the same time yesterday
  • GreaterThanLastWeek: greater than the metric value at the same time last week
  • LessThanLastWeek: less than the metric value at the same time last week
  • GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
  • LessThanLastPeriod: less than the metric value in the last monitoring cycle
Dimensions String [{"taskId": "cc641dff-c19d-45f3-ad0a-818a0c4f****" }]

The dimension of the alert rule.

EvaluationCount String 3

The consecutive number of times for which the metric value is measured before an alert is triggered.

Expression String $Availability=30

The expression that is used to trigger alerts.

Level String 2

The severity of the alert. Valid values:

  • 1: critical
  • 2: warning
  • 3: information
MetricName String Availability

The name of the metric.

Namespace String acs_networkmonitor

The namespace of the cloud service.

OkActions String [ "CloudMonitor"]

The alert contact groups to which alert notifications are sent.

Period String 15s

The interval at which the monitoring data is queried. The value is the same as the interval at which metric data is reported. Unit: seconds.

Note If you specify a statistical period for the alert rule, raw data is queried based on the statistical period.
RuleId String bf071ae_7b7aec3817b0fdf****

The ID of the alert rule.

RuleName String rule1

The name of the alert rule.

StateValue String OK

The status of the alert. Valid values:

  • OK: normal.
  • ALARM: The alert is triggered.
Statistics String Availability

The statistical method of the alert rule. Valid values:

  • Availability: the percentage of available detection points
  • AvailableNumber: the number of available detection points
  • ErrorCodeMaximum: a status code for an alert
  • ErrorCodeMinimum: all status codes for a set of alerts
  • Average: response time
Threshold String 30

The alert threshold.

Message String successful

The returned message.

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribeSiteMonitorAttribute
&TaskId=cc641dff-c19d-45f3-ad0a-818a0c4f****
&<Common request parameters>

Sample success responses

XML format

<DescribeSiteMonitorAttributeResponse>
	  <MetricRules>
		    <MetricRule>
			      <ComparisonOperator>GreaterThanYesterday</ComparisonOperator>
			      <RuleId>bf071ae_7b7aec3817b0fdf****</RuleId>
			      <Period>15s</Period>
			      <EvaluationCount>3</EvaluationCount>
			      <Dimensions>
				        <taskId>cc641dff-c19d-45f3-ad0a-818a0c4f****</taskId>
			      </Dimensions>
			      <Statistics>Availability</Statistics>
			      <Namespace>acs_networkmonitor</Namespace>
			      <AlarmActions>CloudMonitor</AlarmActions>
			      <MetricName>Availability</MetricName>
			      <OkActions>CloudMonitor</OkActions>
			      <Expression>$Availability=30</Expression>
			      <ActionEnable>true</ActionEnable>
			      <StateValue>OK</StateValue>
			      <Level>2</Level>
			      <RuleName>rule1</RuleName>
			      <Threshold>30</Threshold>
		    </MetricRule>
	  </MetricRules>
	  <Message>successful</Message>
	  <RequestId>D17DF650-7EBD-54D0-903A-1D4E624D7402</RequestId>
	  <Code>200</Code>
	  <Success>true</Success>
	  <SiteMonitors>
		    <OptionJson>
			      <time_out>30000</time_out>
			      <http_method>get</http_method>
		    </OptionJson>
		    <TaskId>cc641dff-c19d-45f3-ad0a-818a0c4f****</TaskId>
		    <Address>https://aliyun.com</Address>
		    <TaskName>test123</TaskName>
		    <TaskType>HTTP</TaskType>
		    <IspCities>
			      <IspCity>
				        <IspName>Alibaba</IspName>
				        <Isp>465</Isp>
				        <CityName>Beijing</CityName>
				        <City>738</City>
			      </IspCity>
		    </IspCities>
		    <TaskState>1</TaskState>
		    <Interval>1</Interval>
	  </SiteMonitors>
</DescribeSiteMonitorAttributeResponse>

JSON format

{
    "MetricRules": {
        "MetricRule": [
            {
                "ComparisonOperator": "GreaterThanYesterday",
                "RuleId": "bf071ae_7b7aec3817b0fdf****",
                "Period": "15s",
                "EvaluationCount": 3,
                "Dimensions": [
                    {
                        "taskId": "cc641dff-c19d-45f3-ad0a-818a0c4f****"
                    }
                ],
                "Statistics": "Availability",
                "Namespace": "acs_networkmonitor",
                "AlarmActions": [
                    "CloudMonitor"
                ],
                "MetricName": "Availability",
                "OkActions": [
                    "CloudMonitor"
                ],
                "Expression": "$Availability=30",
                "ActionEnable": true,
                "StateValue": "OK",
                "Level": 2,
                "RuleName": "rule1",
                "Threshold": "30"
            }
        ]
    },
    "Message": "successful",
    "RequestId": "D17DF650-7EBD-54D0-903A-1D4E624D7402",
    "Code": "200",
    "Success": true,
    "SiteMonitors": {
        "OptionJson": {
            "time_out": 30000,
            "http_method": "get"
        },
        "TaskId": "cc641dff-c19d-45f3-ad0a-818a0c4f****",
        "Address": "https://aliyun.com",
        "TaskName": "test123",
        "TaskType": "HTTP",
        "IspCities": {
            "IspCity": [
                {
                    "IspName": "Alibaba",
                    "Isp": "465",
                    "CityName": "Beijing",
                    "City": "738"
                }
            ]
        },
        "TaskState": 1,
        "Interval": 1
    }
}

Error codes

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