You can call the DescribeMonitoringAgentHosts operation to query a list of all hosts, regardless of whether the CloudMonitor agent is installed.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cms:DescribeMonitoringAgentHosts |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| KeyWord |
string |
No |
The keyword for a fuzzy search. |
host1 |
| HostName |
string |
No |
The hostname. |
hostNam1 |
| InstanceIds |
string |
No |
The instance ID. |
i-a3d1q1pm2f9yr29e**** |
| SerialNumbers |
string |
No |
The serial number of the host. A globally unique serial number is generated after the CloudMonitor agent is successfully installed on a host. Hosts that are not Alibaba Cloud instances do not have an instance ID, but have a serial number. Note
Use this parameter to find a specific monitored host. |
a1ab31a3-1234-40f2-9e95-c8caa8f0**** |
| PageNumber |
integer |
No |
The page number. |
1 |
| PageSize |
integer |
No |
The number of entries to return on each page. Valid values:
Note
Alibaba Cloud does not limit the maximum value of this parameter. However, setting this parameter to a large value may cause a timeout. |
10 |
| InstanceRegionId |
string |
No |
The region where the instance resides. |
cn-hangzhou |
| AliyunHost |
boolean |
No |
Specifies whether to filter for Alibaba Cloud Elastic Compute Service (ECS) instances. Valid values:
|
true |
| Status |
string |
No |
The status of the host. Valid values:
|
Running |
| SysomStatus |
string |
No |
The status of SysOM. Valid values:
|
running |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response. |
||
| RequestId |
string |
The request ID. |
63EEBB2A-9E51-41E4-9E83-5DE7F3B292E0 |
| Success |
boolean |
Indicates whether the operation was successful. Valid values:
|
true |
| Code |
string |
The status code. Note
A status code of 200 indicates a successful response. |
200 |
| Message |
string |
The error message. |
The Request is not authorization. |
| PageNumber |
integer |
The page number. |
1 |
| PageSize |
integer |
The number of entries per page. |
10 |
| PageTotal |
integer |
The number of pages. |
50 |
| Total |
integer |
The total number of entries. |
10 |
| Hosts |
object |
||
| Host |
array<object> |
The list of hosts. |
|
|
object |
The host. |
||
| SerialNumber |
string |
The serial number of the host. Hosts that are not Alibaba Cloud instances do not have an instance ID, but have a serial number. Note
Use this parameter to find a specific monitored host. |
x12335-6cc8-4a22-9f21-1a00a719**** |
| NatIp |
string |
The NAT IP address. |
192.168.XX.XX |
| HostName |
string |
The hostname. |
hostIP |
| AliUid |
integer |
The ID of the Alibaba Cloud account. |
103201326074**** |
| NetworkType |
string |
The network type. |
vpc |
| InstanceId |
string |
The instance ID. |
i-a2d5q7pm3f9yr212**** |
| isAliyunHost |
boolean |
Indicates whether the host is an Alibaba Cloud instance. Valid values:
|
true |
| EipAddress |
string |
The elastic IP address (EIP). |
192.168.XX.XX |
| AgentVersion |
string |
The agent version. |
3.4.6 |
| IpGroup |
string |
The IP address of the host. Note
Multiple IP addresses are separated by commas (,). |
192.168.XX.XX |
| EipId |
string |
The ID of the EIP. |
eip-bp16i16k9gcezyfrp**** |
| Region |
string |
The region. |
cn-hangzhou |
| InstanceTypeFamily |
string |
The ECS instance type family. |
ecs.n4 |
| OperatingSystem |
string |
The operating system. |
Linux |
Examples
Success response
JSON format
{
"RequestId": "63EEBB2A-9E51-41E4-9E83-5DE7F3B292E0",
"Success": true,
"Code": "200",
"Message": "The Request is not authorization.",
"PageNumber": 1,
"PageSize": 10,
"PageTotal": 50,
"Total": 10,
"Hosts": {
"Host": [
{
"SerialNumber": "x12335-6cc8-4a22-9f21-1a00a719****",
"NatIp": "192.168.XX.XX",
"HostName": "hostIP",
"AliUid": 0,
"NetworkType": "vpc",
"InstanceId": "i-a2d5q7pm3f9yr212****",
"isAliyunHost": true,
"EipAddress": "192.168.XX.XX",
"AgentVersion": "3.4.6",
"IpGroup": "192.168.XX.XX",
"EipId": "eip-bp16i16k9gcezyfrp****",
"Region": "cn-hangzhou",
"InstanceTypeFamily": "ecs.n4",
"OperatingSystem": "Linux"
}
]
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | ParameterInvalid | Illegal parameters. | |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | AccessForbidden | User not authorized to operate on the specified resource. | |
| 404 | ResourceNotFound | The specified resource is not found. | The specified resource is not found. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.