Docs Menu

Docs HomeMongoDB Manual


On this page

  • Access Control

New in version 4.0: Available for MongoDB Community Edition.

Enables or disables free Cloud monitoring for standalones and replica sets.

The command is run against the admin database and has the form:

db.adminCommand( { setFreeMonitoring: 1, action: "<enable|disable>" } )


To run setFreeMonitoring, you must have specified --enableFreeMonitoring command-line option or configuration file set to runtime.

Otherwise, you can only enable or disable at startup. See --enableFreeMonitoring command-line option or for details.

Once enabled, the free monitoring state remains enabled until explicitly disabled. That is, you do not need to re-enable each time you start the server.

mongosh provides the following helper methods for setFreeMonitoring:

You can use db.getFreeMonitoringStatus() to check your free monitoring status.

When running with access control, the user must have the setFreeMonitoring privilege actions on the cluster. That is, a user must have a role that grants the following privilege:

{ resource: { cluster : true }, actions: [ "setFreeMonitoring" ] }

The built-in role clusterMonitor role provides this privilege.

←  getFreeMonitoringStatusSystem Events Auditing Commands →

On this page

Share Feedback
© 2023 MongoDB, Inc.


  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2023 MongoDB, Inc.