Skip to content

Commit 0939194

Browse files
authored
Merge pull request ceph#62782 from bluikko/doc-prompts-mgr
doc/mgr: Promptify CLI commands and other formatting fixes Reviewed-by: Zac Dover <[email protected]>
2 parents b70714d + c4f0f8e commit 0939194

25 files changed

+787
-609
lines changed

doc/mgr/administrator.rst

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,27 @@ Usually, you would set up a ceph-mgr daemon using a tool such
1010
as ceph-ansible. These instructions describe how to set up
1111
a ceph-mgr daemon manually.
1212

13-
First, create an authentication key for your daemon::
13+
First, create an authentication key for your daemon:
1414

15-
ceph auth get-or-create mgr.$name mon 'allow profile mgr' osd 'allow *' mds 'allow *'
15+
.. prompt:: bash #
16+
17+
ceph auth get-or-create mgr.$name mon 'allow profile mgr' osd 'allow *' mds 'allow *'
1618
1719
Place that key as file named ``keyring`` into ``mgr data`` path, which for a cluster "ceph"
1820
and mgr $name "foo" would be ``/var/lib/ceph/mgr/ceph-foo`` respective ``/var/lib/ceph/mgr/ceph-foo/keyring``.
1921

20-
Start the ceph-mgr daemon::
22+
Start the ceph-mgr daemon:
23+
24+
.. prompt:: bash #
2125

22-
ceph-mgr -i $name
26+
ceph-mgr -i $name
2327

2428
Check that the mgr has come up by looking at the output
25-
of ``ceph status``, which should now include a mgr status line::
29+
of ``ceph status``, which should now include a mgr status line:
30+
31+
.. prompt:: bash #
2632

27-
mgr active: $name
33+
mgr active: $name
2834

2935
Client authentication
3036
---------------------
@@ -33,7 +39,7 @@ The manager is a new daemon which requires new CephX capabilities. If you upgrad
3339
a cluster from an old version of Ceph, or use the default install/deploy tools,
3440
your admin client should get this capability automatically. If you use tooling from
3541
elsewhere, you may get EACCES errors when invoking certain ceph cluster commands.
36-
To fix that, add a "mgr allow \*" stanza to your client's cephx capabilities by
42+
To fix that, add a ``mgr allow \*`` stanza to your client's cephx capabilities by
3743
`Modifying User Capabilities`_.
3844

3945
High availability
@@ -95,9 +101,12 @@ information about what functionality each module provides.
95101

96102
Here is an example of enabling the :term:`Dashboard` module:
97103

98-
.. code-block:: console
104+
.. prompt:: bash #
105+
106+
ceph mgr module ls
107+
108+
::
99109

100-
$ ceph mgr module ls
101110
{
102111
"enabled_modules": [
103112
"status"
@@ -107,8 +116,13 @@ Here is an example of enabling the :term:`Dashboard` module:
107116
]
108117
}
109118

110-
$ ceph mgr module enable dashboard
111-
$ ceph mgr module ls
119+
.. prompt:: bash #
120+
121+
ceph mgr module enable dashboard
122+
ceph mgr module ls
123+
124+
::
125+
112126
{
113127
"enabled_modules": [
114128
"status",
@@ -118,7 +132,12 @@ Here is an example of enabling the :term:`Dashboard` module:
118132
]
119133
}
120134

121-
$ ceph mgr services
135+
.. prompt:: bash #
136+
137+
ceph mgr services
138+
139+
::
140+
122141
{
123142
"dashboard": "http://myserver.com:7789/"
124143
}
@@ -157,9 +176,11 @@ Calling module commands
157176
Where a module implements command line hooks, the commands will
158177
be accessible as ordinary Ceph commands. Ceph will automatically incorporate
159178
module commands into the standard CLI interface and route them appropriately to
160-
the module.::
179+
the module.
180+
181+
.. prompt:: bash #
161182

162-
ceph <command | help>
183+
ceph <command | help>
163184

164185
Configuration
165186
-------------

doc/mgr/alerts.rst

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,44 +16,58 @@ as well.
1616
Enabling
1717
--------
1818

19-
The *alerts* module is enabled with::
19+
The *alerts* module is enabled with:
2020

21-
ceph mgr module enable alerts
21+
.. prompt:: bash #
22+
23+
ceph mgr module enable alerts
2224

2325
Configuration
2426
-------------
2527

2628
To configure SMTP, all of the following config options must be set
27-
(When setting ``mgr/alerts/smtp_destination``, you can use commas to separate multiple)::
29+
(When setting ``mgr/alerts/smtp_destination``, you can use commas to separate multiple):
30+
31+
.. prompt:: bash #
32+
33+
ceph config set mgr mgr/alerts/smtp_host *<smtp-server>*
34+
ceph config set mgr mgr/alerts/smtp_destination *<email-address-to-send-to>*
35+
ceph config set mgr mgr/alerts/smtp_sender *<from-email-address>*
36+
37+
By default, the module will use SSL and port 465. To change that:
2838

29-
ceph config set mgr mgr/alerts/smtp_host *<smtp-server>*
30-
ceph config set mgr mgr/alerts/smtp_destination *<email-address-to-send-to>*
31-
ceph config set mgr mgr/alerts/smtp_sender *<from-email-address>*
39+
.. prompt:: bash #
3240

33-
By default, the module will use SSL and port 465. To change that,::
41+
ceph config set mgr mgr/alerts/smtp_ssl false # if not SSL
42+
ceph config set mgr mgr/alerts/smtp_port *<port-number>* # if not 465
3443

35-
ceph config set mgr mgr/alerts/smtp_ssl false # if not SSL
36-
ceph config set mgr mgr/alerts/smtp_port *<port-number>* # if not 465
44+
To authenticate to the SMTP server, you must set the user and password:
3745

38-
To authenticate to the SMTP server, you must set the user and password::
46+
.. prompt:: bash #
3947

40-
ceph config set mgr mgr/alerts/smtp_user *<username>*
41-
ceph config set mgr mgr/alerts/smtp_password *<password>*
48+
ceph config set mgr mgr/alerts/smtp_user *<username>*
49+
ceph config set mgr mgr/alerts/smtp_password *<password>*
4250

4351
By default, the name in the ``From:`` line is simply ``Ceph``. To
44-
change that (e.g., to identify which cluster this is),::
52+
change that (e.g., to identify which cluster this is):
4553

46-
ceph config set mgr mgr/alerts/smtp_from_name 'Ceph Cluster Foo'
54+
.. prompt:: bash #
55+
56+
ceph config set mgr mgr/alerts/smtp_from_name 'Ceph Cluster Foo'
4757

4858
By default, the module will check the cluster health once per minute
4959
and, if there is a change, send a message. To change that
50-
frequency,::
60+
frequency:
61+
62+
.. prompt:: bash #
5163

52-
ceph config set mgr mgr/alerts/interval *<interval>* # e.g., "5m" for 5 minutes
64+
ceph config set mgr mgr/alerts/interval *<interval>* # e.g., "5m" for 5 minutes
5365

5466
Commands
5567
--------
5668

57-
To force an alert to be send immediately,::
69+
To force an alert to be send immediately:
70+
71+
.. prompt:: bash #
5872

59-
ceph alerts send
73+
ceph alerts send

doc/mgr/ceph_api/index.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,11 @@ be obtained, and it may then be reused for subsequent requests. The
5353
{ "token": "<redacted_token>", ...}
5454

5555
The token obtained must be passed together with every API request in the
56-
``Authorization`` HTTP header::
56+
``Authorization`` HTTP header:
5757

58-
curl -H "Authorization: Bearer <token>" ...
58+
.. prompt:: bash $
59+
60+
curl -H "Authorization: Bearer <token>" ...
5961

6062
Authentication and authorization can be further configured from the
6163
Ceph CLI, the Ceph-Dashboard UI and the Ceph API itself (please refer to

doc/mgr/cli_api.rst

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,47 @@ benchmarked for further testing.
77
Enabling
88
--------
99

10-
The *cli api commands* module is enabled with::
10+
The *cli api commands* module is enabled with:
1111

12-
ceph mgr module enable cli_api
12+
.. prompt:: bash #
1313

14-
To check that it is enabled, run::
14+
ceph mgr module enable cli_api
1515

16-
ceph mgr module ls | grep cli_api
16+
To check that it is enabled, run:
17+
18+
.. prompt:: bash #
19+
20+
ceph mgr module ls | grep cli_api
1721

1822
Usage
1923
--------
2024

21-
To run a mgr module command, run::
25+
To run a mgr module command, run:
26+
27+
.. prompt:: bash #
28+
29+
ceph mgr cli <command> <param>
30+
31+
For example, use the following command to print the list of servers:
32+
33+
.. prompt:: bash #
34+
35+
ceph mgr cli list_servers
2236

23-
ceph mgr cli <command> <param>
37+
List all available mgr module commands with:
2438

25-
For example, use the following command to print the list of servers::
39+
.. prompt:: bash #
2640

27-
ceph mgr cli list_servers
41+
ceph mgr cli --help
2842

29-
List all available mgr module commands with::
43+
To benchmark a command, run:
3044

31-
ceph mgr cli --help
45+
.. prompt:: bash #
3246

33-
To benchmark a command, run::
47+
ceph mgr cli_benchmark <number of calls> <number of threads> <command> <param>
3448

35-
ceph mgr cli_benchmark <number of calls> <number of threads> <command> <param>
49+
For example, use the following command to benchmark the command to get osd_map:
3650

37-
For example, use the following command to benchmark the command to get osd_map::
51+
.. prompt:: bash #
3852

39-
ceph mgr cli_benchmark 100 10 get osd_map
53+
ceph mgr cli_benchmark 100 10 get osd_map

doc/mgr/crash.rst

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ it in the Ceph cluster for later analysis.
66
Enabling
77
--------
88

9-
The *crash* module is enabled with::
9+
The *crash* module is enabled with:
1010

11-
ceph mgr module enable crash
11+
.. prompt:: bash #
1212

13-
The *crash* upload key is generated with::
13+
ceph mgr module enable crash
1414

15-
ceph auth get-or-create client.crash mon 'profile crash' mgr 'profile crash'
15+
The *crash* upload key is generated with:
16+
17+
.. prompt:: bash #
18+
19+
ceph auth get-or-create client.crash mon 'profile crash' mgr 'profile crash'
1620

1721
On each node, you should store this key in
1822
``/etc/ceph/ceph.client.crash.keyring``.
@@ -39,57 +43,57 @@ and a keyring needs to be in ``/etc/ceph``.
3943

4044
Commands
4145
--------
42-
::
46+
.. prompt:: bash #
4347

44-
ceph crash post -i <metafile>
48+
ceph crash post -i <metafile>
4549

4650
Save a crash dump. The metadata file is a JSON blob stored in the crash
4751
dir as ``meta``. As usual, the ceph command can be invoked with ``-i -``,
4852
and will read from stdin.
4953

50-
::
54+
.. prompt:: bash #
5155

52-
ceph crash rm <crashid>
56+
ceph crash rm <crashid>
5357

5458
Remove a specific crash dump.
5559

56-
::
60+
.. prompt:: bash #
5761

58-
ceph crash ls
62+
ceph crash ls
5963

6064
List the timestamp/uuid crashids for all new and archived crash info.
6165

62-
::
66+
.. prompt:: bash #
6367

64-
ceph crash ls-new
68+
ceph crash ls-new
6569

6670
List the timestamp/uuid crashids for all newcrash info.
6771

68-
::
72+
.. prompt:: bash #
6973

70-
ceph crash stat
74+
ceph crash stat
7175

7276
Show a summary of saved crash info grouped by age.
7377

74-
::
78+
.. prompt:: bash #
7579

76-
ceph crash info <crashid>
80+
ceph crash info <crashid>
7781

7882
Show all details of a saved crash.
7983

80-
::
84+
.. prompt:: bash #
8185

8286
ceph crash prune <keep>
8387

8488
Remove saved crashes older than 'keep' days. <keep> must be an integer.
8589

86-
::
90+
.. prompt:: bash #
8791

8892
ceph crash archive <crashid>
8993

9094
Archive a crash report so that it is no longer considered for the ``RECENT_CRASH`` health check and does not appear in the ``crash ls-new`` output (it will still appear in the ``crash ls`` output).
9195

92-
::
96+
.. prompt:: bash #
9397

9498
ceph crash archive-all
9599

0 commit comments

Comments
 (0)