turbot/alicloud
steampipe plugin install alicloud

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,
region
from
alicloud_cms_monitor_host;
select
host_name,
instance_id,
is_aliyun_host as ali_uid,
ip_group,
operating_system,
region
from
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 status
from
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 status
from
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_host
from
alicloud_cms_monitor_host
where
is_aliyun_host;
select
host_name,
is_aliyun_host
from
alicloud_cms_monitor_host
where
is_aliyun_host = 1;

Schema for alicloud_cms_monitor_host

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
account_idtextThe Alicloud Account ID in which the resource is located.
agent_versiontextThe version of the Cloud Monitor agent.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
ali_uidbigintThe ID of the Alibaba Cloud account.
eip_addresstextThe elastic IP address (EIP) of the host.
eip_idtextThe ID of the EIP.
host_nametext=The name of the host.
instance_idtext=The ID of the instance.
instance_type_familytextThe type of the ECS instance.
ip_grouptextThe IP address of the host.
is_aliyun_hostbooleanIndicates whether the host is provided by Alibaba Cloud.
monitoring_agent_statusjsonbThe status of the Cloud Monitor agent.
nat_iptextThe IP address of the Network Address Translation (NAT) gateway.
network_typetextThe type of the network.
operating_systemtextThe operating system.
regiontextThe Alicloud region in which the resource is located.
serial_numbertextThe serial number of the host. A host that is not provided by Alibaba Cloud has a serial number instead of an instance ID.
titletextTitle 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