db.getFreeMonitoringStatus
On this page
db.getFreeMonitoringStatus()-
Returns information on free monitoring status.
mongoshhelperdb.getFreeMonitoringStatus()is a wrapper around thegetFreeMonitoringStatuscommand.Tip
See also:
Access Control
When running with access control, the user must have the checkFreeMonitoringStatus privilege actions on the cluster. That is, a user must have a role that grants the following privilege:
{ resource: { cluster : true }, actions: [ "checkFreeMonitoringStatus" ] }
The built-in role clusterMonitor role provides this privilege.
Output
The method returns a document with the following fields:
| Field | Description |
|---|---|
state | The free monitoring enablement state. Values are either:
"enabled" or "disabled". |
message | Any informational message related to your state. |
url | The unique URL at which your monitoring data can be accessed.
NoteAnyone with whom you share this unique URL can access your monitored data.
|
userReminder | Any informational message related to your state. |
ok | Status of the getFreeMonitoringStatus operation itself. Values are either:
|
Example
You can use db.getFreeMonitoringStatus() to check your free monitoring status
db.getFreeMonitoringStatus()
The method returns information on your free monitoring status.
{
"state" : "enabled",
"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().",
"url" : "https://cloud.mongodb.com/freemonitoring/mongo/MSBjZTZhNTJmOS0yODg1",
"userReminder" : "",
"ok" : 1
}
Tip
See also:
freeMonitoring field returned from db.serverStatus()