getFreeMonitoringStatus

On this page本页内容

getFreeMonitoringStatus

New in version 4.0.在版本4.0中新增

Returns the status of whether free Cloud monitoring is enabled for standalone or replica sets (including shards).返回为独立集或副本集(包括分片)启用免费云监控的状态

The command is run against the admin database and has the form:该命令针对管理数据库运行,格式如下:

db.adminCommand( { getFreeMonitoringStatus: 1 } )

mongosh provides the db.getFreeMonitoringStatus() helper for the command.为命令提供db.getFreeMonitoringStatus()帮助程序。

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 command 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 the 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, if collected less than 24 hours ago.即使禁用,也会返回您的唯一URL,这样,如果您重新启用监控,则可以访问以前的度量(如果在24小时之前集合到)。

userReminderAny informational message related to your state.与您的状态相关的任何信息性消息。
okoperationTime$clusterTime For details on these fields, see Response.有关这些字段的详细信息,请参阅响应
Tip提示
See also: 参阅:
←  Free Monitoring CommandssetFreeMonitoring →