# Can't disable metricbeat metrics module

**URL:** <https://discuss.elastic.co/t/cant-disable-metricbeat-metrics-module/134271>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [June 1, 2018, 8:33pm UTC](https://discuss.elastic.co/t/cant-disable-metricbeat-metrics-module/134271 "2018-06-01T20:33:58Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![fozboz](https://avatars.discourse-cdn.com/v4/letter/f/df788c/32.png) [@fozboz](https://discuss.elastic.co/u/fozboz)\
**Post date:** [June 1, 2018, 8:33pm UTC](https://discuss.elastic.co/t/cant-disable-metricbeat-metrics-module/134271/1 "2018-06-01T20:33:58Z")

</div>

It seems that I'm unable to disable to metrics module in metricbeat. My metricbeat.yml is thusly:

```auto

output.logstash:
  hosts: ["logstash1:5044","logstash2:5044"]
  loadbalance: true

metricbeat.modules:
- module: apache
  enabled: false
  period: 60s
  hosts: ["http://127.0.0.1"]
  metricsets: ["status"]
  server_status_path: server-status
  username:
  password:
- module: haproxy
  enabled: false
  period: 60s
  hosts: ["tcp://127.0.0.1:14567"]
  metricsets: ["info","stat"]
- module: mysql
  enabled: false
  period: 60s
  hosts: ["tcp(127.0.0.1:3306)/"]
  metricsets: ["status"]
  username:
  password:
- module: mongodb
  enabled: false
  period: 60s
  hosts: ["127.0.0.1:40001"]
  metricsets: ["dbstats","status"]
  username:
  password:
- module: nginx
  enabled: false
  period: 60s
  hosts: ["http://127.0.0.1/"]
  metricsets: ["stubstatus"]
  server_status_path: server-status
- module: php_fpm
  enabled: false
  period: 60s
  hosts: ["127.0.0.1:8080"]
  metricsets: ["pool"]
  status_path: /status
- module: postgresql
  enabled: false
  period: 60s
  hosts: ["postgres://localhost:5432"]
  metricsets: ["database","bgwriter","activity"]
  username:
  password:
- module: system
  enabled: false
  period: 10s
  metricsets: ["cpu","load","core","diskio","filesystem","fsstat","memory","network","process","socket"]
  processes: [""]
- module: zookeeper
  enabled: false
  period: 60s
  metricsets: ["mntr"]
  hosts: ["localhost:2181"]

```

So everything is disabled, but I'm still getting metrics appearing in ElasticSearch. Moreover, metricbeat starts by logging this:

```auto
2018-05-28T15:06:46.879-0400 INFO instance/beat.go:475 Beat UUID: 9012999a-0b52-4940-8c11-db6d2047cd85
2018-05-28T15:06:46.879-0400 INFO instance/beat.go:213 Setup Beat: metricbeat; Version: 6.2.4
2018-05-28T15:06:46.880-0400 INFO pipeline/module.go:76 Beat name: metrics
2018-05-28T15:06:46.881-0400 WARN [cfgwarn] socket/socket.go:49 BETA: The system collector metricset is beta
2018-05-28T15:06:46.900-0400 INFO [monitoring] log/log.go:97 Starting metrics logging every 30s
2018-05-28T15:06:46.901-0400 INFO instance/beat.go:301 metricbeat start running.

```

I'm confused.

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [June 4, 2018, 9:13am UTC](https://discuss.elastic.co/t/cant-disable-metricbeat-metrics-module/134271/2 "2018-06-04T09:13:24Z")

</div>

Can you share how you start Metricbeat and which version you are using?

Is the above your full config file or an excerpt?

---

<div class="post-metadata">

**Author:** ![fozboz](https://avatars.discourse-cdn.com/v4/letter/f/df788c/32.png) [@fozboz](https://discuss.elastic.co/u/fozboz)\
**Post date:** [June 4, 2018, 1:54pm UTC](https://discuss.elastic.co/t/cant-disable-metricbeat-metrics-module/134271/3 "2018-06-04T13:54:06Z")

</div>

Starting with `systemctl start metricbeat`.  
Version 6.2.4 installed from the Debian repo.  
That is the full config file.

---

<div class="post-metadata">

**Author:** ![fozboz](https://avatars.discourse-cdn.com/v4/letter/f/df788c/32.png) [@fozboz](https://discuss.elastic.co/u/fozboz)\
**Post date:** [June 5, 2018, 6:17pm UTC](https://discuss.elastic.co/t/cant-disable-metricbeat-metrics-module/134271/4 "2018-06-05T18:17:19Z")

</div>

Update: this only occurs on 14.04.

16.04 nodes exit as expected with

```auto
2018-06-05T14:05:18.783-0400 INFO instance/beat.go:468 Home path: [/usr/share/metricbeat] Config path: [/etc/metricbeat] Data path: [/var/lib/metricbeat] Logs path: [/var/log/metricbeat]
2018-06-05T14:05:18.783-0400 INFO instance/beat.go:475 Beat UUID: 813a4cf9-6631-4d9b-a233-8f62a2706738
2018-06-05T14:05:18.783-0400 INFO instance/beat.go:213 Setup Beat: metricbeat; Version: 6.2.4
2018-06-05T14:05:18.784-0400 INFO pipeline/module.go:76 Beat name: metrics
2018-06-05T14:05:18.785-0400 ERROR instance/beat.go:667 Exiting: all modules are disabled

```

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [June 6, 2018, 11:50am UTC](https://discuss.elastic.co/t/cant-disable-metricbeat-metrics-module/134271/5 "2018-06-06T11:50:03Z")

</div>

Can you try to run metricbeat on 14.04 manually and see if you get the same behaviour. I'm wondering if a path to a config file is wrong.

---

<div class="post-metadata">

**Author:** ![fozboz](https://avatars.discourse-cdn.com/v4/letter/f/df788c/32.png) [@fozboz](https://discuss.elastic.co/u/fozboz)\
**Post date:** [June 6, 2018, 5:50pm UTC](https://discuss.elastic.co/t/cant-disable-metricbeat-metrics-module/134271/6 "2018-06-06T17:50:54Z")

</div>

Sorry, I said previously we were using `systemctl` but with this being 14.04, we're using the init scripts that come with the metricbeat package. I also told you we were issuing the `start` command but we were in fact using `restart` after changing config.

I can get the expected result by stopping and then starting metricbeat. So...

`service metricbeat restart`

results in the correct `Exiting: all modules are disabled` message, but the thread continues to run and metrics continue to be sent to ElasticSearch.

Running `service metricbeat stop` and then `service metricbeat start` gives me the expected outcome.

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [June 12, 2018, 7:27am UTC](https://discuss.elastic.co/t/cant-disable-metricbeat-metrics-module/134271/7 "2018-06-12T07:27:58Z")

</div>

For my understanding: Start / Stop works as expected. But when you run restart the old metricbeat instance does not shut down and the new one that is tried to start returns the error?

---

<div class="post-metadata">

**Author:** ![fozboz](https://avatars.discourse-cdn.com/v4/letter/f/df788c/32.png) [@fozboz](https://discuss.elastic.co/u/fozboz)\
**Post date:** [June 19, 2018, 2:49pm UTC](https://discuss.elastic.co/t/cant-disable-metricbeat-metrics-module/134271/8 "2018-06-19T14:49:25Z")

</div>

Yes exactly. Just tested on a clean 1404 system.

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [July 3, 2018, 9:08am UTC](https://discuss.elastic.co/t/cant-disable-metricbeat-metrics-module/134271/9 "2018-07-03T09:08:49Z")

</div>

Sorry for the long delay on this on. I tried to reproduce this with a fresh ubuntu:14.04 container and installed metricbeat. It seems start / stop and restart had the same effect.

---

<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:** [July 31, 2018, 9:08am UTC](https://discuss.elastic.co/t/cant-disable-metricbeat-metrics-module/134271/10 "2018-07-31T09:08:51Z")

</div>

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