Skip to content

Commit

Permalink
Add details about MongoDB permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnelson committed Apr 6, 2018
1 parent fe31ce9 commit caac224
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions plugins/inputs/mongodb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,20 @@
## Use SSL but skip chain & host verification
# insecure_skip_verify = false
```
This connection uri may be different based on your environment and mongodb
setup. If the user doesn't have the required privilege to execute serverStatus
command the you will get this error on telegraf

#### Permissions:

If your MongoDB instance has access control enabled you will need to connect
as a user with sufficient rights.

With MongoDB 3.4 and higher, the `clusterMonitor` role can be used. In
version 3.2 you may also need these additional permissions:
```
> db.grantRolesToUser("user", [{role: "read", actions: "find", db: "local"}])
```

If the user is missing required privileges you may see an error in the
Telegraf logs similar to:
```
Error in input [mongodb]: not authorized on admin to execute command { serverStatus: 1, recordStats: 0 }
```
Expand Down

0 comments on commit caac224

Please sign in to comment.