Table: alicloud_cms_monitor_host - Query Alibaba Cloud Monitor Hosts using SQL
Alibaba Cloud Monitor Hosts is a feature within Alibaba Cloud Monitor that provides real-time monitoring of the performance of Elastic Compute Service (ECS) instances and custom hosts. It offers a centralized way to monitor and manage the performance of resources, ensuring smooth and efficient operation. Alibaba Cloud Monitor Hosts helps users stay informed about the health and performance of their resources and take appropriate actions when predefined conditions are met.
Table Usage Guide
The alicloud_cms_monitor_host
table provides insights into the performance of Elastic Compute Service (ECS) instances and custom hosts in Alibaba Cloud. As a system administrator or a DevOps engineer, you can explore host-specific details through this table, including the current status, network traffic, and associated metadata. Utilize it to uncover information about hosts, such as those with high CPU usage or network traffic, and to verify their performance.
Examples
Basic info
Explore which hosts are part of the Aliyun network and determine their geographical location and operating system. This information can help you understand the distribution and setup of your network, thus aiding in better resource allocation and security planning.
select host_name, instance_id, is_aliyun_host ali_uid, ip_group, operating_system, regionfrom alicloud_cms_monitor_host;
select host_name, instance_id, is_aliyun_host as ali_uid, ip_group, operating_system, regionfrom alicloud_cms_monitor_host;
Get the status of each host
This query allows you to assess the status of each host within your cloud management system. It provides valuable insights into which hosts are active, which are inactive, and which have automatic installation enabled, aiding in efficient system management and troubleshooting.
select host_name, m ->> 'InstanceId' as instance_id, m -> 'AutoInstall' as auto_install, m -> 'Status' as statusfrom alicloud_cms_monitor_host, jsonb_array_elements(monitoring_agent_status) as m;
select host_name, json_extract(m.value, '$.InstanceId') as instance_id, json_extract(m.value, '$.AutoInstall') as auto_install, json_extract(m.value, '$.Status') as statusfrom alicloud_cms_monitor_host, json_each(monitoring_agent_status) as m;
List hosts provided by Alibaba Cloud
Discover the segments that consist of hosts provided by Alibaba Cloud. This can be beneficial for understanding your cloud resource distribution and for managing your cloud infrastructure more effectively.
select host_name, is_aliyun_hostfrom alicloud_cms_monitor_hostwhere is_aliyun_host;
select host_name, is_aliyun_hostfrom alicloud_cms_monitor_hostwhere is_aliyun_host = 1;
Schema for alicloud_cms_monitor_host
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The Alicloud Account ID in which the resource is located. |
agent_version | text | The version of the Cloud Monitor agent. | |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
ali_uid | bigint | The ID of the Alibaba Cloud account. | |
eip_address | text | The elastic IP address (EIP) of the host. | |
eip_id | text | The ID of the EIP. | |
host_name | text | = | The name of the host. |
instance_id | text | = | The ID of the instance. |
instance_type_family | text | The type of the ECS instance. | |
ip_group | text | The IP address of the host. | |
is_aliyun_host | boolean | Indicates whether the host is provided by Alibaba Cloud. | |
monitoring_agent_status | jsonb | The status of the Cloud Monitor agent. | |
nat_ip | text | The IP address of the Network Address Translation (NAT) gateway. | |
network_type | text | The type of the network. | |
operating_system | text | The operating system. | |
region | text | The Alicloud region in which the resource is located. | |
serial_number | text | The serial number of the host. A host that is not provided by Alibaba Cloud has a serial number instead of an instance ID. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
title | text | Title of the resource. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- alicloud
You can pass the configuration to the command with the --config
argument:
steampipe_export_alicloud --config '<your_config>' alicloud_cms_monitor_host