mongodb_monitor user Permissions Requirements

Document ID : KB000102345
Last Modified Date : 18/06/2018
Show Technical Document Details
Question:
What are the user permissions requirements to configure a user that will be used in mongodb_monitor probe to connect and monitor mongodb ? 
Environment:
UIM version 8.5.1
mongodb version 3.4.1
mongodb_monitor probe 1.20 
Answer:
Here is a command to create a role for MongoDB cluster monitoring:
db.createRole( { role: "uim", privileges: [ { resource: { cluster: true }, actions: [ "find", "replSetGetStatus", "shutdown", "getCmdLineOpts", "getShardMap", "serverStatus" ] }, { resource: { db: "config", collection: "" }, actions: [ "find", "update", "insert", "remove" ] }, { resource: { db: "", collection: "" }, actions: [ "find" ] } ], roles: ["clusterMonitor", "read"] }, { w: "majority" , wtimeout: 10000 } )