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()
帮助程序。
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 command returns a document with the following fields:该命令返回包含以下字段的文档:
state | "enabled" or "disabled" . "enabled" 或"disabled" 。 |
message | |
url |
|
userReminder | |
ok operationTime $clusterTime |
freeMonitoring
field returned from db.serverStatus()
db.serverStatus()
返回的freeMonitoring
字段