# Host Metrics not captured for centos7

**URL:** https://discuss.elastic.co/t/host-metrics-not-captured-for-centos7/152875
**Category:** Beats
**Tags:** metricbeat
**Created:** [October 17, 2018, 4:33pm UTC](https://discuss.elastic.co/t/host-metrics-not-captured-for-centos7/152875 "2018-10-17T16:33:08Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Jas\_Ahluwalia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jas_ahluwalia/32/34915_2.png) [@Jas\_Ahluwalia](https://discuss.elastic.co/u/Jas_Ahluwalia)
#### Post date: [October 17, 2018, 4:33pm UTC](https://discuss.elastic.co/t/host-metrics-not-captured-for-centos7/152875/1 "2018-10-17T16:33:08Z")

</div>

Hi,

I'm running metricbeat in a docker container. I'm unable to see the host's metrics in the dashboard (e.g. cpu usage, memory, etc.).

Below is what i have in my docker compose file in terms of volume mounts and flags:

```auto
 metricbeat:
    image: metricbeat
    user: root
    restart: on-failure
    networks:
      - mynet
    volumes:
      - /proc:/hostfs/proc:ro
      - /sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro
      - /:/hostfs:ro
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - ELASTICSEARCH_HOST=http://elasticsearch:9200
      - KIBANA_HOST=https://kibana:5001
    command: ["--strict.perms=false", "-system.hostfs=/hostfs", "-"]
    depends_on:
      - elasticsearch

```

And here are the contents of my metricbeat.yml:

```auto
#-------------------------------- Autodiscovery -------------------------------
metricbeat.autodiscover:
  providers:
    - type: docker
      templates:
        - condition.contains:
            docker.container.image: redis
          config:
            - module: redis
              metricsets: ["info", "keyspace"]
              hosts: "${data.host}:${data.port}"

metricbeat.modules:
#------------------------------- System Module -------------------------------
- module: system
  metricsets: ["cpu", "load", "memory", "network", "process", "process_summary", "core", "diskio", "socket"]
  processes: ['.*']
  process.include_top_n:
    by_cpu: 5
    by_memory: 5
  period: 10s
  cpu.metrics: ["percentages"]
  core.metrics: ["percentages"]

- module: system
  period: 1m
  metricsets:
    - filesystem
    - fsstat
  processors:
  - drop_event.when.regexp:
      system.filesystem.mount_point: '^/(sys|cgroup|proc|dev|etc|host|lib)($|/)'

- module: system
  period: 15m
  metricsets:
    - uptime

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

#------------------------------- Processors -------------------------------
processors:
- add_docker_metadata: ~
- add_cloud_metadata: ~
- add_locale: ~

#-------------------------- Elasticsearch output ------------------------------
output.elasticsearch:
  hosts: ["http://elasticsearch:9200"]

xpack.monitoring:
  enabled: true
  elasticsearch:

#============================== Dashboards =====================================
# These settings control loading the sample dashboards to the Kibana index.
# Loading the dashboards is disabled by default and can be enabled either by setting the options here, or by using the `-setup` CLI flag.
setup.dashboards:
  enabled: true

setup.dashboards.retry.enabled: true

setup.kibana:
  host: "https://kibana:5601"
  protocol: "https"
  ssl.enabled: true
  ssl.certificate_authorities: ["/usr/share/metricbeat/certs/ca.crt"]
  ssl.certificate: "/usr/share/metricbeat/certs/kibana.crt"
  ssl.key: "/usr/share/metricbeat/certs/kibana.key"

```

Does anything look wrong to you? Am I missing something? Your help is much appreciated.

Thanks,  
Jas

---

<div class="post-metadata">

### Author: ![Mario\_Castro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mario_castro/32/35107_2.png) [@Mario\_Castro](https://discuss.elastic.co/u/Mario_Castro)
#### Post date: [October 17, 2018, 5:07pm UTC](https://discuss.elastic.co/t/host-metrics-not-captured-for-centos7/152875/2 "2018-10-17T17:07:36Z")

</div>

Hi @Jas_Ahluwalia 🙂

Frankly, I don't see any errors on your config files. Can you paste some log outputs?

---

<div class="post-metadata">

### Author: ![Jas\_Ahluwalia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jas_ahluwalia/32/34915_2.png) [@Jas\_Ahluwalia](https://discuss.elastic.co/u/Jas_Ahluwalia)
#### Post date: [October 17, 2018, 5:33pm UTC](https://discuss.elastic.co/t/host-metrics-not-captured-for-centos7/152875/3 "2018-10-17T17:33:31Z")

</div>

Hi,

Here is a link to the logfile for metricbeat:

[https://file.io/wLVFxc](https://file.io/wLVFxc)

Thanks,  
jas

---

<div class="post-metadata">

### Author: ![Mario\_Castro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mario_castro/32/35107_2.png) [@Mario\_Castro](https://discuss.elastic.co/u/Mario_Castro)
#### Post date: [October 17, 2018, 5:50pm UTC](https://discuss.elastic.co/t/host-metrics-not-captured-for-centos7/152875/4 "2018-10-17T17:50:11Z")

</div>

> [@Jas\_Ahluwalia](#):
>
> [Deleted](https://file.io/wLVFxc)

404 not found 🙃

---

<div class="post-metadata">

### Author: ![Jas\_Ahluwalia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jas_ahluwalia/32/34915_2.png) [@Jas\_Ahluwalia](https://discuss.elastic.co/u/Jas_Ahluwalia)
#### Post date: [October 17, 2018, 5:58pm UTC](https://discuss.elastic.co/t/host-metrics-not-captured-for-centos7/152875/5 "2018-10-17T17:58:29Z")

</div>

Hmm....let's try this one:

> **[metricbeat.txt](https://www.dropbox.com/s/f4fy8oldghv4ghp/metricbeat.txt?dl=0)**
>
> Shared with Dropbox

I didn't see much in there, i think there is something about elasticsearch not being up, but eventually it comes up and everything should be fine. But maybe your eyes will catch something.

Thanks,  
Jas

---

<div class="post-metadata">

### Author: ![Mario\_Castro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mario_castro/32/35107_2.png) [@Mario\_Castro](https://discuss.elastic.co/u/Mario_Castro)
#### Post date: [October 17, 2018, 6:24pm UTC](https://discuss.elastic.co/t/host-metrics-not-captured-for-centos7/152875/6 "2018-10-17T18:24:45Z")

</div>

You commented that you were using docker compose and the config of Elasticsearch seems quite barebones. I'm wondering if it has something in relation with launching it in cluster mode? Maybe try with the "single node" launch `docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:6.4.2` as described here:

[https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-cli-run](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-cli-run)

I don't think this is the problem but meanwhile I'm gonna ask some partner too because I can't see anything relevant in the logs either

---

<div class="post-metadata">

### Author: ![Jas\_Ahluwalia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jas_ahluwalia/32/34915_2.png) [@Jas\_Ahluwalia](https://discuss.elastic.co/u/Jas_Ahluwalia)
#### Post date: [October 17, 2018, 8:34pm UTC](https://discuss.elastic.co/t/host-metrics-not-captured-for-centos7/152875/7 "2018-10-17T20:34:32Z")

</div>

Appreciate it. And yeah, single node didn't really have an effect.

Thanks,  
Jas

---

<div class="post-metadata">

### Author: ![Jas\_Ahluwalia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jas_ahluwalia/32/34915_2.png) [@Jas\_Ahluwalia](https://discuss.elastic.co/u/Jas_Ahluwalia)
#### Post date: [October 18, 2018, 8:05pm UTC](https://discuss.elastic.co/t/host-metrics-not-captured-for-centos7/152875/8 "2018-10-18T20:05:28Z")

</div>

Hi Mario,

I think I was able to figure out something. I had removed the system dashboard from my container, and I believe the host dashboard was going to a hard coded host id for the host dashboard that didn't exist. When i revert back to the original dashboards, things seem to look better.

However, when I chose "last 15 mins," everything alwasy says zero (processor, mem usage). If I say last 30 mins, i start to get some data.

Can I get some guidance on how to get the settings in my metricbeat.yml and "last 15 mins" to line up better? is there a notion of "current live view?"

Thanks,  
Jas

---

<div class="post-metadata">

### Author: ![Mario\_Castro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mario_castro/32/35107_2.png) [@Mario\_Castro](https://discuss.elastic.co/u/Mario_Castro)
#### Post date: [October 20, 2018, 6:02pm UTC](https://discuss.elastic.co/t/host-metrics-not-captured-for-centos7/152875/9 "2018-10-20T18:02:26Z")

</div>

Forgive me for the delay @Jas_Ahluwalia

@exekias can you help us with this issue, please?

---

<div class="post-metadata">

### Author: ![Jas\_Ahluwalia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jas_ahluwalia/32/34915_2.png) [@Jas\_Ahluwalia](https://discuss.elastic.co/u/Jas_Ahluwalia)
#### Post date: [October 23, 2018, 10:48pm UTC](https://discuss.elastic.co/t/host-metrics-not-captured-for-centos7/152875/10 "2018-10-23T22:48:31Z")

</div>

No worries. I'm still having the same issue with time interval at 'last 15 mins.'

Thanks,  
Jas

---

<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 20, 2018, 10:48pm UTC](https://discuss.elastic.co/t/host-metrics-not-captured-for-centos7/152875/11 "2018-11-20T22:48:32Z")

</div>

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