# Vsphere metric in windows trying to connect on localhost address

**URL:** <https://discuss.elastic.co/t/vsphere-metric-in-windows-trying-to-connect-on-localhost-address/260277>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [January 6, 2021, 6:49am UTC](https://discuss.elastic.co/t/vsphere-metric-in-windows-trying-to-connect-on-localhost-address/260277 "2021-01-06T06:49:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rohan0018](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rohan0018/32/79007_2.png) [@rohan0018](https://discuss.elastic.co/u/rohan0018)\
**Post date:** [January 6, 2021, 6:49am UTC](https://discuss.elastic.co/t/vsphere-metric-in-windows-trying-to-connect-on-localhost-address/260277/1 "2021-01-06T06:49:02Z")

</div>

Hi!!!  
I have installed and enabled vsphere metricbeat module on my vcenter server.  
I have configured vsphere.yml as below.  
'''''metricbeat.modules:

- module: vsphere  
enabled: true  
metricsets: ["datastore", "host", "virtualmachine"]  
period: 10s  
hosts: ["[https://vcenterserver/sdk](https://vcenterserver/sdk)"]

''''

But when I start metricbeat service its logs that vsphere module trying connect vCenter server at localhost address as below.  
'Error fetching data for metricset vsphere.virtualmachine: error in NewClient: Post "[https://localhost/sdk](https://localhost/sdk)":' even if I have configured correct vcenter address in vsphere.yml file.

---

<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 7, 2021, 3:09pm UTC](https://discuss.elastic.co/t/vsphere-metric-in-windows-trying-to-connect-on-localhost-address/260277/2 "2021-01-07T15:09:23Z")

</div>

This is the address from default configuration. Can you make sure you edit the correct configuration for the module?

C.

---

<div class="post-metadata">

**Author:** ![rohan0018](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rohan0018/32/79007_2.png) [@rohan0018](https://discuss.elastic.co/u/rohan0018)\
**Post date:** [January 11, 2021, 3:34am UTC](https://discuss.elastic.co/t/vsphere-metric-in-windows-trying-to-connect-on-localhost-address/260277/3 "2021-01-11T03:34:49Z")

</div>

Hi!!

Yes, I have edited vsphere.yml file from c:\ProgramData\Elastic\Beats\metricbeat\modules.d\vsphere.yml.

below is the configuration in yml file.  
"module: vsphere  
enabled: true  
metricsets: ["datastore", "host", "virtualmachine"]  
period: 10s  
hosts: ["[https://vcenterserverfqdn/sdk](https://vcenterserverfqdn/sdk)"]

username: "administrator@vsphere.local"  
password: "password"

If insecure is true, don't verify the server's certificate chain  
insecure: false

Get custom fields when using virtualmachine metric set. Default false.  
get\_custom\_fields: false

---

<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 8, 2021, 3:35am UTC](https://discuss.elastic.co/t/vsphere-metric-in-windows-trying-to-connect-on-localhost-address/260277/4 "2021-02-08T03:35:10Z")

</div>

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