-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
db.disableFreeMonitoring.txt
82 lines (56 loc) · 2.47 KB
/
db.disableFreeMonitoring.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
==========================
db.disableFreeMonitoring()
==========================
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
.. method:: db.disableFreeMonitoring()
Disables :doc:`free Cloud monitoring </administration/free-monitoring>`.
.. important::
To run :method:`db.disableFreeMonitoring()`, you must have
specified :option:`--enableFreeMonitoring <mongod
--enableFreeMonitoring>` command-line option or
:setting:`cloud.monitoring.free.state` configuration file set to
``runtime``.
Otherwise, you can only enable or disable at startup. See
:option:`--enableFreeMonitoring <mongod --enableFreeMonitoring>`
command-line option or :setting:`cloud.monitoring.free.state` for
details.
The :method:`db.disableFreeMonitoring()` method is a wrapper around
the :dbcommand:`setFreeMonitoring` command.
Access Control
--------------
When running with access control, the user must have the
:authaction:`setFreeMonitoring` privilege actions on the :ref:`cluster
<resource-document>`. That is, a user must have a :ref:`role <roles>`
that grants the following :ref:`privilege <privileges>`:
.. code-block:: javascript
{ resource: { cluster : true }, actions: [ "setFreeMonitoring" ] }
The built-in role :authrole:`clusterMonitor` role provides this
privilege.
Example
-------
To disable free monitoring, run the following from the
:binary:`~bin.mongo` shell:
.. code-block:: javascript
db.disableFreeMonitoring()
You can use :method:`db.getFreeMonitoringStatus()` to check your of
free monitoring status:
.. code-block:: javascript
db.getFreeMonitoringStatus()
If free monitoring is disabled, the method returns a document similar to:
.. code-block:: javascript
{
"state" : "disabled",
"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
}
Even when disabled, your unique URL is returned so that if you
re-enable monitoring at a later time, you can access your previous
metrics that has not expired within the past 24 hours.
.. seealso:: :method:`db.enableFreeMonitoring()`