- Reference >
- Database Commands >
- Free Monitoring Commands >
- setFreeMonitoring
setFreeMonitoring¶
On this page
-
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
admindatabase and has the form:Important
To run
setFreeMonitoring, you must have specified--enableFreeMonitoringcommand-line option orcloud.monitoring.free.stateconfiguration file set toruntime.Otherwise, you can only enable or disable at startup. See
--enableFreeMonitoringcommand-line option orcloud.monitoring.free.statefor 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.
mongoshprovides the following helper methods forsetFreeMonitoring:You can use
db.getFreeMonitoringStatus()to check your free monitoring status.
Access Control¶
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:
The built-in role clusterMonitor role provides this
privilege.