db.getFreeMonitoringStatus

On this page本页内容

db.getFreeMonitoringStatus()

Returns information on free monitoring status.返回有关免费监视状态的信息。

mongosh helper db.getFreeMonitoringStatus() is a wrapper around the getFreeMonitoringStatus command.helper db.getFreeMonitoringStatus()getFreeMonitoringStatus命令的包装器。

Tip提示
See also: 参阅:

Access Control访问控制

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角色提供此权限。

Output输出

The method returns a document with the following fields:该方法返回包含以下字段的文档:

Field字段Description描述
stateThe free monitoring enablement state. 自由监视启用状态。Values are either: "enabled" or "disabled". 值可以是:"enabled""disabled"
messageAny informational message related to your state.与您所在州相关的任何信息消息。
url

The unique URL at which your monitoring data can be accessed.可以访问监控数据的唯一URL。

Note注意

Anyone with whom you share this unique URL can access your monitored data.与您共享此唯一URL的任何人都可以访问您的监控数据。

Even when disabled, your unique URL is returned so that if you re-enable monitoring, you can access your previous metrics.即使禁用,也会返回您的唯一URL,以便如果重新启用监视,您可以访问以前的度量。

userReminderAny informational message related to your state.与您所在州相关的任何信息消息。
ok

Status of the getFreeMonitoringStatus operation itself. getFreeMonitoringStatus操作本身的状态。Values are either:值为:

  • 1 if the operation was successful.如果操作成功,则为1
  • 0 if the operation was not successful.如果操作不成功,则为0

Example示例

You can use db.getFreeMonitoringStatus() to check your free monitoring status您可以使用db.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
}
Tip提示
See also: 参阅:
←  db.enableFreeMonitoring()Object Constructors and Methods →