mongodb: readme update (#4754)
Ilya Mashchenko committed
Nov 26, 2018 at 23:05 UTC
79df60266d07033ed4dc652f95a1140297506116
1 file changed
+27
collectors/python.d.plugin/mongodb/README.md
+27
@@ -121,6 +121,33 @@ Number of charts depends on mongodb version, storage engine and other features (
121
26. **Replication set member heartbeat latency**
122
* member (time when last heartbeat was received from replica set member)
123
124
+### prerequisite
125
+Create a read-only user for the netdata in the admin database.
126
+
127
+1. Authenticate as the admin user.
128
+
129
+```
130
+use admin
131
+db.auth("admin", "<MONGODB_ADMIN_PASSWORD>")
132
+```
133
+
134
+2. Create a user.
135
+
136
+```
137
+# MongoDB 2.x.
138
+db.addUser("netdata", "<UNIQUE_PASSWORD>", true)
139
+
140
+# MongoDB 3.x or higher.
141
+db.createUser({
142
+ "user":"netdata",
143
+ "pwd": "<UNIQUE_PASSWORD>",
144
+ "roles" : [
145
+ {role: 'read', db: 'admin' },
146
+ {role: 'clusterMonitor', db: 'admin'},
147
+ {role: 'read', db: 'local' }
148
+ ]
149
+})
150
+```
151
152
### configuration
153