On this page本页内容
db.getFreeMonitoringStatus() Returns information on free monitoring status.返回有关免费监视状态的信息。
mongosh helper helper db.getFreeMonitoringStatus() is a wrapper around the getFreeMonitoringStatus command.db.getFreeMonitoringStatus()是getFreeMonitoringStatus命令的包装器。
When running with access control, the user must have the 使用访问控制运行时,用户必须对群集执行checkFreeMonitoringStatus privilege actions on the cluster. checkFreeMonitoringStatus权限操作。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.clusterMonitor角色提供此权限。
The method returns a document with the following fields:该方法返回包含以下字段的文档:
state | "enabled" or "disabled". "enabled"或"disabled"。 |
message | |
url |
|
userReminder | |
ok |
|
You can use 您可以使用db.getFreeMonitoringStatus() to check your free monitoring statusdb.getFreeMonitoringStatus()检查您的空闲监视状态
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
}
从freeMonitoring field returned from db.serverStatus()db.serverStatus()返回的freeMonitoring字段