setFreeMonitoring

  • setFreeMonitoring

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:

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

Important

To run setFreeMonitoring, you must have specified—enableFreeMonitoringcommand-line option or cloud.monitoring.free.stateconfiguration file set to runtime.

Otherwise, you can only enable or disable at startup. See—enableFreeMonitoringcommand-line option or cloud.monitoring.free.state fordetails.

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

The mongo shell provides the following helper methodsfor setFreeMonitoring:

Access Control

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

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

The built-in role clusterMonitor role provides thisprivilege.