# Heartbeat - verify tcp ports failed with timeout and socket error

**URL:** https://discuss.elastic.co/t/heartbeat-verify-tcp-ports-failed-with-timeout-and-socket-error/104130
**Category:** Beats
**Tags:** heartbeat
**Created:** [October 16, 2017, 5:26pm UTC](https://discuss.elastic.co/t/heartbeat-verify-tcp-ports-failed-with-timeout-and-socket-error/104130 "2017-10-16T17:26:00Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![arun\_prasath1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arun_prasath1/32/49539_2.png) [@arun\_prasath1](https://discuss.elastic.co/u/arun_prasath1)
#### Post date: [October 16, 2017, 5:26pm UTC](https://discuss.elastic.co/t/heartbeat-verify-tcp-ports-failed-with-timeout-and-socket-error/104130/1 "2017-10-16T17:26:00Z")

</div>

I am trying to check the status of TCP ports of servers from Hearbeat client. I am getting 4 output responses in kibana, three are showing status as false and one status is true. Initially it has failed due to timeout and i have increased the timeout period and after that getting the socket time out error.

Requirement:  
In the two servers, I have to verify the ports 80, 443, 8080.

My hearbeat config is below.  
heartbeat.monitors:

- type: tcp  
hosts: ["target.server1.domainl","target.server2.domain"]  
ports: [80, 443, 8080]  
schedule: '@every 1200s'  
timeout: 3000s  
output.elasticsearch:  
hosts: ["elkserver.domain:9200"]  
index: "ports-status--%{+yyyy.MM.dd}"

Error seen in kibana:  
error.message : dial tcp \<ip\_no\>:443: getsockopt: connection timed out

How to troubleshoot this issue ? any clue what is happening in the above code.

---

<div class="post-metadata">

### Author: ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)
#### Post date: [October 18, 2017, 9:37am UTC](https://discuss.elastic.co/t/heartbeat-verify-tcp-ports-failed-with-timeout-and-socket-error/104130/2 "2017-10-18T09:37:47Z")

</div>

The error indicates the attempt to connect to port 443 timed out on the TCP level. That is the TCP handshake did not complete in time (no ACK on initial SYNC).

---

<div class="post-metadata">

### Author: ![arun\_prasath1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arun_prasath1/32/49539_2.png) [@arun\_prasath1](https://discuss.elastic.co/u/arun_prasath1)
#### Post date: [October 20, 2017, 11:08am UTC](https://discuss.elastic.co/t/heartbeat-verify-tcp-ports-failed-with-timeout-and-socket-error/104130/3 "2017-10-20T11:08:10Z")

</div>

I was using the hostname and name was not resolved and able to get this working with the full name. Thanks Steffens.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [November 17, 2017, 11:08am UTC](https://discuss.elastic.co/t/heartbeat-verify-tcp-ports-failed-with-timeout-and-socket-error/104130/4 "2017-11-17T11:08:23Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
