mongodb_monitor user Permissions Requirements

book

Article ID: 102345

calendar_today

Updated On:

Products

DX Infrastructure Management NIMSOFT PROBES

Issue/Introduction



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 

Resolution

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 } )