MongoDB Documentation, Release 3.0.4 The new role grants permissions to kill any operations. Warning: Terminate running operations with extreme caution. Only use db.killOp() to terminate operations initiated by clients and do not terminate internal database operations. Create a Role to Run mongostat The following example creates a role named mongostatRole that provides only the privileges to run mongostat . 72 Step 1: Connect to MongoDB with the appropriate privileges. Connect to mongod or mongos with the privi- leges specified in the Prerequisites (page 389) section. The following procedure uses the siteUserAdmin created in Create a User Administrator (page 384). mongo --port 27017 -u siteUserAdmin -p password --authenticationDatabase admin The siteUserAdmin has privileges to create roles in the admin as well as other databases. Step 2: Create a new role to manage current operations. mongostatRole has privileges that act on the cluster resource (page 418). As such, you must create the role in the admin database. use admin db.createRole( { role: "mongostatRole", privileges: [ { resource: { cluster: true }, actions: [ "serverStatus" ] } ], roles: [] } ) Assign a User a Role Overview Changed in version 2.6. A role provides a user privileges to perform a set of actions (page 419) on a resource (page 417). A user can have multiple roles. In MongoDB systems with authorization enforced, you must grant a user a role for the user to access a database resource. To assign a role, first determine the privileges the user needs and then determine the role that grants those privileges. For an overview of roles and privileges, see Authorization (page 324). For descriptions of the access each built-in role provides, see the section on built-in roles (page 405). 72 The built-in role clusterMonitor (page 409) also provides the privilege to run mongostat along with other privileges. Chapter 6. Security 390