db.getFreeMonitoringStatus

  • db.getFreeMonitoringStatus()
  • Returns information on free monitoring status.

The mongo shell helperdb.getFreeMonitoringStatus() is a wrapper around thegetFreeMonitoringStatus command.

See also

db.enableFreeMonitoring()

Access Control

When running with access control, the user must have thecheckFreeMonitoringStatus privilege actions on thecluster. That is, a user must have arole that grants the following privilege:

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

The built-in role clusterMonitor role provides thisprivilege.

Output

The method returns a document with the following fields:

FieldDescription
stateThe free monitoring enablement state. Values are either:"enabled" or "disabled".
messageAny informational message related to your state.
urlThe unique URL at which your monitoring data can be accessed.NoteAnyone with whom you share this unique URL can access yourmonitored data.Even when disabled, your unique URL is returned so that if youre-enable monitoring, you can access your previous metrics.
userReminderAny informational message related to your state.
okStatus of the getFreeMonitoringStatus operation itself.Values are either:- 1 if the operation was successful.- 0 if the operation was not successful.

Example

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

  1. db.getFreeMonitoringStatus()

The method returns information on your free monitoring status.

  1. {
  2. "state" : "enabled",
  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. }

See also

freeMonitoring field returned from db.serverStatus()