# Error fetching data for metricset beat.state: error making http request: Get "https://xxx.xxxx.cloudapp.azure.com:5066/state": dial tcp connect: connection refused

**URL:** https://discuss.elastic.co/t/error-fetching-data-for-metricset-beat-state-error-making-http-request-get-https-xxx-xxxx-cloudapp-azure-com-5066-state-dial-tcp-connect-connection-refused/294003
**Category:** Beats
**Tags:** beats-module, metricbeat
**Created:** [January 11, 2022, 9:32am UTC](https://discuss.elastic.co/t/error-fetching-data-for-metricset-beat-state-error-making-http-request-get-https-xxx-xxxx-cloudapp-azure-com-5066-state-dial-tcp-connect-connection-refused/294003 "2022-01-11T09:32:42Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![aviad.co1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aviad.co1/32/100122_2.png) [@aviad.co1](https://discuss.elastic.co/u/aviad.co1)
#### Post date: [January 11, 2022, 9:32am UTC](https://discuss.elastic.co/t/error-fetching-data-for-metricset-beat-state-error-making-http-request-get-https-xxx-xxxx-cloudapp-azure-com-5066-state-dial-tcp-connect-connection-refused/294003/1 "2022-01-11T09:32:42Z")

</div>

Hi,  
I'm Build remote monitoring cluster elastic stack to monitor elastic production environment.  
I'm install metricbeats on the target and success to configure elasticsearch-xpack and kibana-xpack, and I see metrics on monitoring cluster.  
but when I try to configure beat-xpack module I get error :

> ERROR module/wrapper.go:259 Error fetching data for metricset beat.stats: error making http request: Get "[https://xxx.xxxx.cloudapp.azure.com:5066/stats](https://xxx.xxxx.cloudapp.azure.com:5066/stats)": dial tcp 137.116.201.167:5066: connect: connection refused

the module file beat-xpack.yml looks like this :

- module: beat  
xpack.enabled: true  
metricsets:
  - stats
  - state  
period: 10s  
hosts: ["[https://xxx.xxx.cloudapp.azure.com:5066](https://xxx.xxx.cloudapp.azure.com:5066)"]  
username: "xxxx"  
password: "xxxxx"  
ssl.verification: "none"  
http.enabled: true

What I'm missing ?

Thank's for your help....

---

<div class="post-metadata">

### Author: ![ChrsMark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrsmark/32/55858_2.png) [@ChrsMark](https://discuss.elastic.co/u/ChrsMark)
#### Post date: [January 11, 2022, 9:46am UTC](https://discuss.elastic.co/t/error-fetching-data-for-metricset-beat-state-error-making-http-request-get-https-xxx-xxxx-cloudapp-azure-com-5066-state-dial-tcp-connect-connection-refused/294003/2 "2022-01-11T09:46:29Z")

</div>

Hi!

Have you enabled Beat's monitoring port?

---

<div class="post-metadata">

### Author: ![aviad.co1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aviad.co1/32/100122_2.png) [@aviad.co1](https://discuss.elastic.co/u/aviad.co1)
#### Post date: [January 11, 2022, 10:42am UTC](https://discuss.elastic.co/t/error-fetching-data-for-metricset-beat-state-error-making-http-request-get-https-xxx-xxxx-cloudapp-azure-com-5066-state-dial-tcp-connect-connection-refused/294003/3 "2022-01-11T10:42:42Z")

</div>

Hi,

What do you mean ? need to add port parameter to beat-xpack.yml ?

---

<div class="post-metadata">

### Author: ![ChrsMark](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrsmark/32/55858_2.png) [@ChrsMark](https://discuss.elastic.co/u/ChrsMark)
#### Post date: [January 11, 2022, 10:59am UTC](https://discuss.elastic.co/t/error-fetching-data-for-metricset-beat-state-error-making-http-request-get-https-xxx-xxxx-cloudapp-azure-com-5066-state-dial-tcp-connect-connection-refused/294003/4 "2022-01-11T10:59:38Z")

</div>

I see in your config that `http.enabled: true` is on module's level but I guess this should on top level of Metricbeat's config.

See more info at [Use Metricbeat to send monitoring data | Metricbeat Reference [7.16] | Elastic](https://www.elastic.co/guide/en/beats/metricbeat/current/monitoring-metricbeat-collection.html).

The error you are hitting indicates that the monitoring endpoint is not reachable.

---

<div class="post-metadata">

### Author: ![aviad.co1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aviad.co1/32/100122_2.png) [@aviad.co1](https://discuss.elastic.co/u/aviad.co1)
#### Post date: [January 13, 2022, 9:08pm UTC](https://discuss.elastic.co/t/error-fetching-data-for-metricset-beat-state-error-making-http-request-get-https-xxx-xxxx-cloudapp-azure-com-5066-state-dial-tcp-connect-connection-refused/294003/5 "2022-01-13T21:08:42Z")

</div>

Hi,  
I add `http.enabled: true`. and work as reference you send.

**add this lines to metricbeats.yml :**  
monitoring.enabled: false  
http.enabled: true  
http.port: 5067  
monitoring.cluster\_uuid: "5p4sQBp2SjO2TOI5lPGigw"

**beat-xpack.yml :**

- module: beat  
xpack.enabled: true  
metricsets:
  - stats
  - state  
period: 10s  
hosts: ["[https://xxx.xxxx.xxx.xxx.com:5067](https://xxx.xxxx.xxx.xxx.com:5067)"]  
username: "remote\_monitoring\_user"  
password: "xxxxxxxxxxx"  
ssl.verification: "none"  
http.enabled: true  
http.host: "xxx.xxx.xxx.xxx.xxx"  
http.port: 5067

still get the same error , please, what am I missing, ?

---

<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: [February 10, 2022, 11:09pm UTC](https://discuss.elastic.co/t/error-fetching-data-for-metricset-beat-state-error-making-http-request-get-https-xxx-xxxx-cloudapp-azure-com-5066-state-dial-tcp-connect-connection-refused/294003/6 "2022-02-10T23:09:16Z")

</div>

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