db.disableFreeMonitoring()

  • db.disableFreeMonitoring()

New in version 4.0.

Disables free Cloud monitoring.

Important

To run db.disableFreeMonitoring(), you must havespecified —enableFreeMonitoring command-line option orcloud.monitoring.free.state configuration file set toruntime.

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

The db.disableFreeMonitoring() method is a wrapper aroundthe setFreeMonitoring command.

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.

Example

To disable free monitoring, run the following from themongo shell:

  1. db.disableFreeMonitoring()

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

  1. db.getFreeMonitoringStatus()

If free monitoring is disabled, the method returns a document similar to:

  1. {
  2. "state" : "disabled",
  3. "message" : "To see your monitoring data, navigate to the unique URL below.\nAnyone you share the URL with will also be able to view this page.\n\nhttps://cloud.mongodb.com/freemonitoring/mongo/MSBjZTZhNTJmOS0yODg1\n\nYou can disable monitoring at any time by running db.disableFreeMonitoring().",
  4. "url" : "https://cloud.mongodb.com/freemonitoring/mongo/MSBjZTZhNTJmOS0yODg1",
  5. "userReminder" : "",
  6. "ok" : 1
  7. }

Even when disabled, your unique URL is returned so that if youre-enable monitoring at a later time, you can access your previousmetrics that has not expired within the past 24 hours.

See also

db.enableFreeMonitoring()