# Issue with monitoring service on MongoDB

**URL:** <https://forums.percona.com/t/issue-with-monitoring-service-on-mongodb/5545>\
**Category:** PMM 1.x\
**Created:** [April 13, 2017, 10:24am UTC](https://forums.percona.com/t/issue-with-monitoring-service-on-mongodb/5545 "2017-04-13T10:24:47Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![rfinnertywu](https://avatars.discourse-cdn.com/v4/letter/r/ec9cab/32.png) [@rfinnertywu](https://forums.percona.com/u/rfinnertywu)\
**Post date:** [April 13, 2017, 10:24am UTC](https://forums.percona.com/t/issue-with-monitoring-service-on-mongodb/5545/1 "2017-04-13T10:24:47Z")

</div>

Hello,

I am new to MongoDB and am setting up the PMM client on a 3-node cluster for the first time. On the first node I am working on, I got the linux metrics monitoring to work with no issues. But I am having trouble getting the mongodb:metrics service into a Running state.

When I run pmm-admin list, it shows the service at not running. I have tried numerous commands to get the service to start. Each time I run one of the below commands, I see a return message stating “OK, started mongodb:metrics service for \<servername\>”

These are the commands I have run so far:

pmm-admin add mongodb:metrics

pmm-admin add mongodb:metrics --uri mongodb://dbuser:@0.0.0.0:27017/admin --cluster rs0

pmm-admin add mongodb:metrics --uri mongodb://dbuser:@localhost:27017/admin --cluster rs0

I verified I can log into the Mongo instance using the dbusert account, which has admin privileges.

I have also run the start command numerous times, but am seeing the same results.

Any help with this would be appreciated- Thanks

---

<div class="post-metadata">

**Author:** ![Mykola](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mykola/32/30_2.png) [@Mykola](https://forums.percona.com/u/Mykola)\
**Post date:** [April 13, 2017, 10:32am UTC](https://forums.percona.com/t/issue-with-monitoring-service-on-mongodb/5545/2 "2017-04-13T10:32:20Z")

</div>

can you try start service by the following line?

```auto
pmm-admin start mongodb:metrics

```

---

<div class="post-metadata">

**Author:** ![rfinnertywu](https://avatars.discourse-cdn.com/v4/letter/r/ec9cab/32.png) [@rfinnertywu](https://forums.percona.com/u/rfinnertywu)\
**Post date:** [April 13, 2017, 2:44pm UTC](https://forums.percona.com/t/issue-with-monitoring-service-on-mongodb/5545/3 "2017-04-13T14:44:24Z")

</div>

Thanks Mykola- I have tried that several times, but did not work. I just tried again and get this message: OK, started mongodb:metrics service

but the service still showing as not running.

I am seeing this in the mongodb metrics log:

E0413 16:23:36.979584 381 server\_status.go:126] Failed to get server status.  
panic: collector has no descriptors

Thanks,

Ron

---

<div class="post-metadata">

**Author:** ![Mykola](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mykola/32/30_2.png) [@Mykola](https://forums.percona.com/u/Mykola)\
**Post date:** [April 14, 2017, 8:40am UTC](https://forums.percona.com/t/issue-with-monitoring-service-on-mongodb/5545/4 "2017-04-14T08:40:25Z")

</div>

Hi Ron,

I am trying to reproduce issue, what mongodb version do you use?

maybe I’ll prepare some custom patch with better error debug output on the next week…

---

<div class="post-metadata">

**Author:** ![rfinnertywu](https://avatars.discourse-cdn.com/v4/letter/r/ec9cab/32.png) [@rfinnertywu](https://forums.percona.com/u/rfinnertywu)\
**Post date:** [April 14, 2017, 7:40pm UTC](https://forums.percona.com/t/issue-with-monitoring-service-on-mongodb/5545/5 "2017-04-14T19:40:55Z")

</div>

Hi Mykola,

We are using version 3.2.11. Please let me know if you need any additional information

Ron

---

<div class="post-metadata">

**Author:** ![Mykola](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mykola/32/30_2.png) [@Mykola](https://forums.percona.com/u/Mykola)\
**Post date:** [April 18, 2017, 2:50am UTC](https://forums.percona.com/t/issue-with-monitoring-service-on-mongodb/5545/6 "2017-04-18T02:50:27Z")

</div>

Hi Ron,

I started MongoDB from this rpm [url][https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.2/x86\_64/RPMS/mongodb-org-3.2.11-1.el7.x86\_64.rpm[/url]](https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.2/x86_64/RPMS/mongodb-org-3.2.11-1.el7.x86_64.rpm%5B/url%5D)  
after that I created user

```auto
echo 'db.createUser({user: "someuser", pwd: "somepass", roles: [{ role: "userAdmin", db: "admin" }] })' \
| mongo localhost:27017/admin

```

and checked credentials by this command

```auto
echo 'db.runCommand( { serverStatus: 1, recordStats: 0 } )' \
| mongo --username someuser --password somepass --host localhost --port 27017 --authenticationDatabase admin

```

and succesfully configured pmm by this command

```auto
pmm-admin add mongodb --cluster somecluster --uri someuser:somepass&#64;localhost:27017 some-instance

```

can you try these commands on your system?

---

<div class="post-metadata">

**Author:** ![rfinnertywu](https://avatars.discourse-cdn.com/v4/letter/r/ec9cab/32.png) [@rfinnertywu](https://forums.percona.com/u/rfinnertywu)\
**Post date:** [April 18, 2017, 7:54am UTC](https://forums.percona.com/t/issue-with-monitoring-service-on-mongodb/5545/7 "2017-04-18T07:54:20Z")

</div>

Hi Mykola,

After running the above commands, I think the issue is with the privileges granted to the userAdmin role on the servers here. It looks like there are no privileges assigned to this role- I am not sure if this is by default or was done by the initial installer.

I have not been able to find a listing of the privileges needed for the pmm db user - do you have this info handy?

Thanks,

Ron

---

<div class="post-metadata">

**Author:** ![Mykola](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mykola/32/30_2.png) [@Mykola](https://forums.percona.com/u/Mykola)\
**Post date:** [April 18, 2017, 9:10am UTC](https://forums.percona.com/t/issue-with-monitoring-service-on-mongodb/5545/8 "2017-04-18T09:10:45Z")

</div>

can you try command from mongodb\_exporter documentation?

```auto
db.getSiblingDB("admin").createUser({
user: "mongodb_exporter",
pwd: "s3cr3tpassw0rd",
roles: [
{ role: "clusterMonitor", db: "admin" },
{ role: "read", db: "local" }
]
})

```

source [URL][GitHub - percona/mongodb\_exporter: A Prometheus exporter for MongoDB including sharding, replication and storage engines](https://github.com/percona/mongodb_exporter#usage%5B/URL%5D)

---

<div class="post-metadata">

**Author:** ![rfinnertywu](https://avatars.discourse-cdn.com/v4/letter/r/ec9cab/32.png) [@rfinnertywu](https://forums.percona.com/u/rfinnertywu)\
**Post date:** [April 18, 2017, 10:01am UTC](https://forums.percona.com/t/issue-with-monitoring-service-on-mongodb/5545/9 "2017-04-18T10:01:46Z")

</div>

Hi Mykola- I actually went ahead and granted the privileges in your above command to my pmm user and it works now. Thank you very much for the assistance!

Ron

---

<div class="post-metadata">

**Author:** ![Mykola](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/mykola/32/30_2.png) [@Mykola](https://forums.percona.com/u/Mykola)\
**Post date:** [April 18, 2017, 11:12am UTC](https://forums.percona.com/t/issue-with-monitoring-service-on-mongodb/5545/10 "2017-04-18T11:12:56Z")

</div>

Ron, thank you

Tim created ticket about improving documentation - [PMM-785](https://jira.percona.com/browse/PMM-785)  
so it will improved in future 🙂

---

<div class="post-metadata">

**Author:** ![rfinnertywu](https://avatars.discourse-cdn.com/v4/letter/r/ec9cab/32.png) [@rfinnertywu](https://forums.percona.com/u/rfinnertywu)\
**Post date:** [April 19, 2017, 7:21am UTC](https://forums.percona.com/t/issue-with-monitoring-service-on-mongodb/5545/11 "2017-04-19T07:21:26Z")

</div>

Great- thanks again for the help!

Ron
