# Metricset 'postgresql/bgwriter' is not registered, module not found

**URL:** <https://discuss.elastic.co/t/metricset-postgresql-bgwriter-is-not-registered-module-not-found/61020>\
**Category:** Beats\
**Created:** [September 20, 2016, 1:55pm UTC](https://discuss.elastic.co/t/metricset-postgresql-bgwriter-is-not-registered-module-not-found/61020 "2016-09-20T13:55:54Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [October 5, 2016, 9:30pm UTC](https://discuss.elastic.co/t/metricset-postgresql-bgwriter-is-not-registered-module-not-found/61020/21 "2016-10-05T21:30:54Z")

</div>

What command are you using to start Metricbeat?

---

<div class="post-metadata">

**Author:** ![agonzalez](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@agonzalez](https://discuss.elastic.co/u/agonzalez)\
**Post date:** [October 5, 2016, 9:33pm UTC](https://discuss.elastic.co/t/metricset-postgresql-bgwriter-is-not-registered-module-not-found/61020/22 "2016-10-05T21:33:36Z")

</div>

/etc/init.d/metricbeat start

but to avoid the error i had to edit that file and add at the top:

```
### END INIT INFO

unset -v PGSERVICEFILE
unset -v PGSYSCONFDIR
unset -v PGSSLMODE

```

If metricbeat is incompatible with those vars i think the start script should unset them by default to avoid this error to users using it.

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [October 5, 2016, 9:36pm UTC](https://discuss.elastic.co/t/metricset-postgresql-bgwriter-is-not-registered-module-not-found/61020/23 "2016-10-05T21:36:19Z")

</div>

> [@agonzalez](#):
>
> Shouldnt you include by default in the metricbeat init.d the commands to unset the vars?

That job is generally left to `service` on SysV. From `man service`:

> service runs a System V init script in as predictable environment as possible, removing most environment variables and with current working directory set to /.

So try running `sudo service metricbeat start`. That should execute the service from a clean environment.

---

<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:** [October 11, 2016, 1:55pm UTC](https://discuss.elastic.co/t/metricset-postgresql-bgwriter-is-not-registered-module-not-found/61020/24 "2016-10-11T13:55:55Z")

</div>

This topic was automatically closed after 21 days. New replies are no longer allowed.

[Previous page](https://discuss.elastic.co/t/metricset-postgresql-bgwriter-is-not-registered-module-not-found/61020.md?page=1)
