This topic describes how to use Alibaba Cloud Heartbeat to check the status of Internet Control Message Protocol (ICMP) and HTTP services. It can also generate visual charts.
- ICMPv4 or ICMPv6 monitor: sends ICMP requests to check whether a service is available. This type of monitor connects to a service over ICMP. If you want to use an ICMP monitor, root permissions are required.
- TCP monitor: sends or receives specific workloads to check whether a service is available. This type of monitor connects to a service over TCP.
- HTTP monitor: checks whether a service is available based on specific status codes, response headers, or response content. This type of monitor connects to a service over HTTP.
Note TCP and HTTP monitors support Secure Sockets Layer (SSL), Transport Layer Security (TLS), and some proxy settings.
- An Alibaba Cloud Elasticsearch cluster is created.
For more information, see Create an Elasticsearch cluster.
- The Auto Indexing feature is enabled for the Elasticsearch cluster.
For security purposes, Alibaba Cloud Elasticsearch disables the Auto Indexing feature by default. However, Beats depends on this feature. If you select Elasticsearch for Output when you create a shipper, you must enable the Auto Indexing feature. For more information, see Enable auto indexing.
- An Alibaba Cloud Elastic Compute Service (ECS) instance is created in the same virtual private cloud (VPC) as the Elasticsearch cluster.
For more information, see Create an instance by using the provided wizard.Notice Beats supports only Aliyun Linux, Red Hat Linux, and CentOS.
- Cloud Assistant and Docker are installed on the ECS instance.
- Log on to the Alibaba Cloud Elasticsearch console. In the left-side navigation pane, click Beats Data Shippers.
- In the Create Shipper section of the page that appears, click Heartbeat.
- Install and configure the shipper.
For more information, see Install a shipper and Prepare the YML configuration files for a shipper. The following figure shows the configurations that are used in this topic.Note
When you configure the shipper, specify
- If you select Enable Kibana Monitoring, the system enables Heartbeat service monitoring in the Kibana console.
- If you select Enable Kibana Dashboard, the system generates charts in the Kibana console. You do not need to configure the YML file. Alibaba Cloud Kibana is configured in a VPC. You must enable the VPC access feature for Kibana on the Kibana configuration page. For more information, see Configure a whitelist for access to the Kibana console over the Internet or an internal network.
heartbeat.monitorsin heartbeat.yml to configure monitors. The following monitor configurations are used in this topic:
heartbeat.monitors: - type: icmp schedule: '*/5 * * * * * *' hosts: ["47.111.xx.xx"] - type: http # List or urls to query urls: ["https://es-cn-xxxxx.kibana.elasticsearch.aliyuncs.com:5601/"] # Configure task schedule schedule: '@every 10s' check.response.status: 200
The monitor type. In the preceding configurations,
httpmonitors are specified.
The task schedule. If you set the value to
'*/5 * * * * * *', the system runs the task at 5-second intervals. If you set the value to
'@every 10s', the system runs the task at 10-second intervals from the time Heartbeat is started.
The servers that you want to ping.
The URLs that you want to ping.
The expected HTTP status code that is returned for the HTTP request. If you set the value to
200, the system determines that the related service is normal if
200is returned.Note For more information, see open source Heartbeat documentation.
- Select the ECS instance on which you want to install the shipper.
The selected ECS instance must meet the preceding prerequisites.
- Enable the shipper and check whether the shipper installation succeeds.
- Click Enable.
Then, the Enable Shipper message appears.
- Click Back to Beats Shippers. In the Manage Shippers section of the Beats Data Shippers page, view the installed shipper.
- After the state of the shipper changes to Enabled 1/1, click View Instances in the Actions column.
- In the View Instances pane, check whether the shipper installation on the ECS instance succeeds. If the value of Installed Shippers is Heartbeat Normal, the shipper installation succeeds.
- Click Enable.
View the collected data
- Log on to the Kibana console of your Elasticsearch cluster.
For more information, see Log on to the Kibana console.
- In the left-side navigation pane, click Discover. On the page that appears, select heartbeat-* from the drop-down list in the upper-left corner and specify a period in the upper-right corner. Then, view the data collected by Heartbeat within the specified period.
- In the left-side navigation pane, click Dashboard.
- In the Dashboards section of the page that appears, click Heartbeat HTTP monitoring. In the upper-right corner of the page that appears, select a period. Then, view HTTP status statistics within the specified period.