Use Logtail to collect ping and tcping data and send it to a MetricStore in Simple Log Service.
Prerequisites
A Project and a MetricStore are required. For more information, see Manage Projects and Create a MetricStore.
Limitations
Only Linux Logtail 1.0.31 or later supports collecting ping and tcping data. If you are using an earlier version of Logtail, you must upgrade it. For more information, see Install Logtail on a Linux server.
Procedure
Log on to the Simple Log Service console.
In the Projects section, click the one you want.

-
On the tab, under the target MetricStore, choose , and then click Add Logtail Configuration.
-
In the Quick Data Import dialog box, click Ping Monitoring.
-
On the Create Machine Group tab:
-
If you have an available machine group, click Use Existing Machine Groups. Select Host scenario and ECS. From the source machine group list, select the target machine group and click > to move it to the applied machine group list. Then, click Next.
-
If no machine groups are available, perform the following steps to create a machine group. In this example, an Elastic Compute Service (ECS) instance is used.
-
On the ECS Instance tab, in the Manually select instances section, select the target ECS instance and click Create.
For more information, see Install Logtail on ECS instances.
ImportantIf you want to collect logs from an ECS instance that belongs to a different Alibaba Cloud account than Simple Log Service, a server in a data center, or a server of a third-party cloud service provider, you must manually install Logtail. For more information, see Install Logtail on a Linux server. After you manually install Logtail, you must configure a user identifier for the server. For more information, see Configure a user identifier.
-
After the installation is complete, click Complete Installation.
-
On the Create Machine Group page, enter a Name and click Next.
In Simple Log Service, you can create IP address-based machine groups and custom identifier-based machine groups. For more information, see Create a machine group.
-
-
-
Confirm that the machine group is displayed in the Applied Server Groups section and click Next.
ImportantIf you apply a machine group immediately after you create the machine group, the heartbeat status of the machine group may be FAIL. This issue occurs because the machine group is not connected to Simple Log Service. To resolve this issue, you can click Automatic Retry. If the issue persists, see What do I do if no heartbeat connections are detected on Logtail?
-
On the Configure Data Source tab, set Configuration Name and Plug-in Configuration, and then click Next.
ImportantThe required 'inputs' parameter specifies the data source configuration. You can configure only one data source type in 'inputs'.
{{ "inputs": [ { "detail": { "tcp": [ { "port": 80, "src": "192.XX.XX.103", "count": 3, "target": "www.aliyun.com" } ], "interval_seconds": 60, "icmp": [ { "src": "192.XX.XX.103", "count": 3, "target": "www.aliyun.com" } ], "http": [ { "src": "192.XX.XX.103", "expect_code": 200, "target": "www.aliyun.com" } ] }, "type": "metric_input_netping" } ] }Parameter
Type
Required
Description
tcp
Array
Yes
The settings to collect TCP ping data. You must replace the sample values with your actual values.
-
port: The port number. -
src: The IP address of the server in the machine group that runs the ping command. -
count: The number of packets to send per ping operation. We recommend that you use the default value of 3. The value must be in the range (0, 10). -
target: The hostname or IP address of the destination host. -
name: The name of the metric. Default value: {src}->{target}. -
labels: The custom labels that you want to add to the metric.
You can add multiple IP addresses. Example:
"tcp": [ { "port": 80, "src": "192.XX.XX.103", "count": 3, "target": "www.aliyun.com" }, { "port": 80, "src": "192.XX.XX.104", "count": 3, "target": "www.aliyun.com" } ]icmp
Array
Yes
The settings to collect ICMP ping data. You must replace the sample values with your actual values.
-
src: The IP address of the server in the machine group that runs the ping command. -
count: The number of packets to send per ping operation. We recommend that you use the default value of 3. The value must be in the range (0, 10). -
target: The hostname or IP address of the destination host. -
name: The name of the metric. Default value: {src}->{target}. -
labels: The custom labels that you want to add to the metric.
You can add multiple IP addresses. Example:
"icmp": [ { "src": "192.XX.XX.103", "count": 3, "target": "www.aliyun.com" }, { "src": "192.XX.XX.104", "count": 3, "target": "www.aliyun.com" } ]http
Array
Yes
The settings to collect HTTP ping data. You must replace the sample values with your actual values.
-
src: The IP address of the server in the machine group that runs the ping command. -
method: The HTTP method for the request. Default value:get. -
expect_response_contains: The string that the response body is expected to contain. -
expect_code: The expected status code. -
target: The destination URL. HTTPS is supported. -
name: The name of the metric. Default value: {src}->{target}. -
labels: The custom labels that you want to add to the metric.
"http": [ { "src": "192.XX.XX.103", "expect_code": 200, "target": "www.aliyun.com" } ]interval_seconds
Integer
Yes
The interval at which the ping command is run. Unit: seconds.
-
Default value: 60.
-
Valid values: [10, 86400)
type
String
Yes
The type of the data source. The value is fixed to
metric_input_netping. -
Next steps
After you collect ping data, you can query and analyze it in a MetricStore. For more information, see Query and analyze time series data. On the query and analysis page, you can use PromQL to query metrics and display ping latency trends as a line chart.
The following table lists the available metrics.
|
Category |
Metric name |
Description |
|
ICMP ping |
ping_failed |
Number of failed packets per icmp ping execution. |
|
ping_rtt_avg_ms |
Average response time per icmp ping execution, in milliseconds. |
|
|
ping_rtt_max_ms |
Maximum response time per icmp ping execution, in milliseconds. |
|
|
ping_rtt_min_ms |
Minimum response time per icmp ping execution, in milliseconds. |
|
|
ping_rtt_stddev_ms |
Standard deviation of the response time per icmp ping execution, in milliseconds. |
|
|
ping_rtt_total_ms |
Total response time per icmp ping execution, in milliseconds. |
|
|
ping_succcess |
Number of successful packets per icmp ping execution. |
|
|
ping_total |
Total number of packets sent per icmp ping execution. |
|
|
TCP ping |
tcping_failed |
Number of failed packets per tcp ping execution. |
|
tcping_rtt_avg_ms |
Average response time per tcp ping execution, in milliseconds. |
|
|
tcping_rtt_max_ms |
Maximum response time per tcp ping execution, in milliseconds. |
|
|
tcping_rtt_min_ms |
Minimum response time per tcp ping execution, in milliseconds. |
|
|
tcpping_rtt_stddev_ms |
Standard deviation of the response time per tcp ping execution, in milliseconds. |
|
|
tcping_rtt_total_ms |
Total response time per tcp ping execution, in milliseconds. |
|
|
tcping_succcess |
Number of successful packets per tcp ping execution. |
|
|
tcping_total |
Total number of packets sent per tcp ping execution. |
|
|
HTTP ping |
httping_failed |
Number of failed attempts per http ping execution. |
|
httping_succcess |
Number of successful attempts per http ping execution. |
|
|
httping_total |
Total number of attempts per http ping execution. |
|
|
httping_rt_ms |
Latency per http ping execution, in milliseconds. |
|
|
httping_response_bytes |
Response size per http ping execution, in bytes. |
|
|
httping_cert_ttl_days |
Certificate time to live (TTL) for each http ping execution, in days. |