# Metricsbeat on docker swarm: how to monitor host/system stats?

**URL:** https://discuss.elastic.co/t/metricsbeat-on-docker-swarm-how-to-monitor-host-system-stats/153297
**Category:** Beats
**Tags:** metricbeat
**Created:** [October 21, 2018, 6:53pm UTC](https://discuss.elastic.co/t/metricsbeat-on-docker-swarm-how-to-monitor-host-system-stats/153297 "2018-10-21T18:53:34Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![gianpietro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gianpietro/32/36744_2.png) [@gianpietro](https://discuss.elastic.co/u/gianpietro)
#### Post date: [October 21, 2018, 6:53pm UTC](https://discuss.elastic.co/t/metricsbeat-on-docker-swarm-how-to-monitor-host-system-stats/153297/1 "2018-10-21T18:53:34Z")

</div>

Hi,

The relevant section of my docker compose file looks like this:

```
user: root
deploy:
  mode: global
volumes:
  - /proc:/hostfs/proc:ro
  - /sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro
  - /:/hostfs:ro
  - ./metricbeat.yml:/usr/share/metricbeat/metricbeat.yml
  - /var/run/docker.sock:/var/run/docker.sock:ro

```

However, the sample dashboard '[Metricbeat System] Host overview' is showing the container's statistics and processes. How can I make it monitor the host?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/1/0126ff5c5bce95da39f5b2aee5093918695bcb1c.png)

The only setting I've not been able to apply is the "network\_mode: host" at the composer since it's not supported in docker swarm and composer v3.

thanks!

---

<div class="post-metadata">

### Author: ![gianpietro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gianpietro/32/36744_2.png) [@gianpietro](https://discuss.elastic.co/u/gianpietro)
#### Post date: [October 21, 2018, 10:41pm UTC](https://discuss.elastic.co/t/metricsbeat-on-docker-swarm-how-to-monitor-host-system-stats/153297/2 "2018-10-21T22:41:15Z")

</div>

I was missing something! **-system.hostfs=/hostfs**

```
command: --strict.perms=false -e -system.hostfs=/hostfs

```

So the only issue left is that reported interfaces belong to the metricbeat container and not to the host, due to the fact that "network\_mode host" can't be used in my setup. Any comments regarding this will be appreciated!

---

<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: [October 22, 2018, 9:04pm UTC](https://discuss.elastic.co/t/metricsbeat-on-docker-swarm-how-to-monitor-host-system-stats/153297/3 "2018-10-22T21:04:35Z")

</div>

Hi @gianpietro,

I believe that currently host network is the only way to achieve this, could you please open a new enhancement request under [https://github.com/elastic/beats/issues](https://github.com/elastic/beats/issues)?

Best regards

---

<div class="post-metadata">

### Author: ![gianpietro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gianpietro/32/36744_2.png) [@gianpietro](https://discuss.elastic.co/u/gianpietro)
#### Post date: [October 22, 2018, 9:32pm UTC](https://discuss.elastic.co/t/metricsbeat-on-docker-swarm-how-to-monitor-host-system-stats/153297/4 "2018-10-22T21:32:48Z")

</div>

Hi @exekias, just did, thank you!

Regards,  
Gianpietro

---

<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 19, 2018, 9:32pm UTC](https://discuss.elastic.co/t/metricsbeat-on-docker-swarm-how-to-monitor-host-system-stats/153297/5 "2018-11-19T21:32:50Z")

</div>

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