# I only see metricbeat container as host

**URL:** https://discuss.elastic.co/t/i-only-see-metricbeat-container-as-host/80025
**Category:** Beats
**Tags:** metricbeat
**Created:** [March 26, 2017, 7:24am UTC](https://discuss.elastic.co/t/i-only-see-metricbeat-container-as-host/80025 "2017-03-26T07:24:51Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![mathias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mathias/32/23176_2.png) [@mathias](https://discuss.elastic.co/u/mathias)
#### Post date: [March 26, 2017, 7:24am UTC](https://discuss.elastic.co/t/i-only-see-metricbeat-container-as-host/80025/1 "2017-03-26T07:24:52Z")

</div>

Hi,

I am using metricbeat inside a container and want this beat to monitor the host and all other neighboring containers.  
Unfortunately I can only see my metricbeat docker as host in most of the dashboards views.

 ![](https://us1.discourse-cdn.com/elastic/original/3X/2/b/2ba78c68179db35700fcb4b3dea3d0fdb86e893a.png)

But when looking at the views showing cpu and memrory consumption per process I can see processes from other docker containers.

![](https://us1.discourse-cdn.com/elastic/original/3X/c/a/ca4d9e063c5627a201653a488c7ce9195aadc27c.png)

Looking at the discover view I see data from all my containers.

 ![](https://us1.discourse-cdn.com/elastic/original/3X/f/1/f1a2f01928908f5ef24ccad6a3b7c47b3c765f4c.png)

My metricbeat configuration looks like this.  
#------------------------------- System Module -------------------------------

- module: system  
metricsets: ["load","core","diskio","filesystem","memory","network","process","socket"]  
enabled: true  
period: 10s  
processes: ['.\*']  
cgroups: true
# Enable collection of cgroup metrics from processes on Linux.
process.cgroups.enabled: true

#------------------------------- Docker Module -------------------------------

- module: docker  
metricsets: ["container", "cpu", "diskio", "info", "memory", "network"]  
hosts: ["unix:///var/run/docker.sock"]  
enabled: true  
period: 10s

I start my metricbeat container with the following command:  
docker run -d --rm --volume=/proc:/hostfs/proc:ro --volume=/sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro --volume=/:/hostfs:ro --volume=/var/run/docker.sock:/var/run/docker.sock:ro --net=host --hostname=metricbeat --name=metricbeat --dns=127.0.0.1 metricbeat

Is my configuration wrong or am I not supposed to be able to see more information about the containers with current dashboards?

Br Mathias

---

<div class="post-metadata">

### Author: ![exekias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/exekias/32/28718_2.png) [@exekias](https://discuss.elastic.co/u/exekias)
#### Post date: [March 27, 2017, 8:42am UTC](https://discuss.elastic.co/t/i-only-see-metricbeat-container-as-host/80025/2 "2017-03-27T08:42:02Z")

</div>

Hi @mathias, thank you for sharing your setup!

It's a common docker behavior to set the container name as hostname inside it, it's handy sometimes, but you can override that 🙂

You can take benefit from [environment var](https://www.elastic.co/guide/en/beats/metricbeat/current/using-environ-vars.html) in beats conf file and do something like:

In metricbeat.yml:

```
name: ${NODE_NAME}

```

In your docker run command:

```
docker run -d ... -e "NODE_NAME=$(hostname)" ... metricbeat

```

This way you have a common way to pass host's hostname to your beats! Let me know if it works for you and fits your needs

Best regards

---

<div class="post-metadata">

### Author: ![mathias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mathias/32/23176_2.png) [@mathias](https://discuss.elastic.co/u/mathias)
#### Post date: [March 27, 2017, 11:43am UTC](https://discuss.elastic.co/t/i-only-see-metricbeat-container-as-host/80025/3 "2017-03-27T11:43:35Z")

</div>

Thanks for your response Carlos,

Unfortunately nothing changed.  
I can only see the metricbeat as hostname for CPU load.

 ![](https://us1.discourse-cdn.com/elastic/original/3X/c/4/c4ee86447741cd5481631bb41db0627d0088f9b0.png)

This is probably natural since I have this configuration:  
metricsets: ["container", "cpu", "diskio", "info", "memory", "network"]

I do not include "load" since it is not supported.

Br Mathias

---

<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: [April 24, 2017, 11:43am UTC](https://discuss.elastic.co/t/i-only-see-metricbeat-container-as-host/80025/4 "2017-04-24T11:43:44Z")

</div>

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