summaryrefslogtreecommitdiff
path: root/deps/rabbit/docs/rabbitmq-diagnostics.8
blob: 7a6d53d0979cb9446d3231a5549f2832f146721a (plain)
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
.\" vim:ft=nroff:
.\" This Source Code Form is subject to the terms of the Mozilla Public 
.\" License, v. 2.0. If a copy of the MPL was not distributed with this
.\" file, You can obtain one at https://mozilla.org/MPL/2.0/.
.\"
.\" Copyright (c) 2007-2020 VMware, Inc. or its affiliates.  All rights reserved.
.\"
.Dd September 28, 2019
.Dt RABBITMQ-DIAGNOSTICS 8
.Os "RabbitMQ Server"
.Sh NAME
.Nm rabbitmq-diagnostics
.Nd RabbitMQ diagnostics, monitoring and health checks tools
.\" ------------------------------------------------------------------
.Sh SYNOPSIS
.\" ------------------------------------------------------------------
.Nm
.Op Fl q
.Op Fl s
.Op Fl l
.Op Fl n Ar node
.Op Fl t Ar timeout
.Ar command
.Op Ar command_options
.\" ------------------------------------------------------------------
.Sh DESCRIPTION
.\" ------------------------------------------------------------------
.Nm
is a command line tool that provides commands used for diagnostics, monitoring
and health checks of RabbitMQ nodes.
See the
.Lk https://rabbitmq.com/documentation.html "RabbitMQ documentation guides"
to learn more about RabbitMQ diagnostics, monitoring and health checks.

.Nm
allows the operator to inspect node and cluster state. A number of
health checks are available to be used interactively and by monitoring tools.

.Pp
By default if it is not possible to connect to and authenticate with the target node
(for example if it is stopped), the operation will fail.
To learn more, see the
.Lk https://rabbitmq.com/monitoring.html "RabbitMQ Monitoring guide"
.
.\" ------------------------------------------------------------------
.Sh OPTIONS
.\" ------------------------------------------------------------------
.Bl -tag -width Ds
.It Fl n Ar node
Default node is
.Qq Pf rabbit@ Ar target-hostname ,
where
.Ar target-hostname
is the local host.
On a host named
.Qq myserver.example.com ,
the node name will usually be
.Qq rabbit@myserver
(unless
.Ev RABBITMQ_NODENAME
has been overridden).
The output of
.Qq hostname -s
is usually the correct suffix to use after the
.Qq @
sign.
See
.Xr rabbitmq-server 8
for details of configuring a RabbitMQ node.
.It Fl q , -quiet
Quiet output mode is selected.
Informational messages are reduced when quiet mode is in effect.
.It Fl s , -silent
Silent output mode is selected.
Informational messages are reduced and table headers are suppressed when silent mode is in effect.
.It Fl t Ar timeout , Fl -timeout Ar timeout
Operation timeout in seconds.
Not all commands support timeouts.
Default is
.Cm infinity .
.It Fl l , Fl -longnames
Must be specified when the cluster is configured to use long (FQDN) node names.
To learn more, see the
.Lk https://rabbitmq.com/clustering.html "RabbitMQ Clustering guide"
.It Fl -erlang-cookie Ar cookie
Shared secret to use to authenticate to the target node.
Prefer using a local file or the
.Ev RABBITMQ_ERLANG_COOKIE
environment variable instead of specifying this option on the command line.
To learn more, see the
.Lk https://rabbitmq.com/cli.html "RabbitMQ CLI Tools guide"
.El
.\" ------------------------------------------------------------------
.Sh COMMANDS
.\" ------------------------------------
.Pp
Most commands provided by
.Nm
inspect node and cluster state or perform health checks.
.Pp
Commands that list topology entities (e.g. queues) use tab as column delimiter.
These commands and their arguments are delegated to rabbitmqctl(8).
.Pp
Some commands (
.Cm list_queues ,
.Cm list_exchanges ,
.Cm list_bindings
and
.Cm list_consumers )
accept an optional
.Ar vhost
parameter.
.Pp
The
.Cm list_queues ,
.Cm list_exchanges
and
.Cm list_bindings
commands accept an optional virtual host parameter for which to display
results.
The default value is
.Qq / .
.El
.Ss Help
.Bl -tag -width Ds
.\" ------------------------------------
.Bl -tag -width Ds
.It Cm help Oo Fl l Oc Op Ar command_name
.Pp
Prints usage for all available commands.
.Bl -tag -width Ds
.It Fl l , Fl -list-commands
List command usages only, without parameter explanation.
.It Ar command_name
Prints usage for the specified command.
.El
.\" ------------------------------------
.It Cm version
.Pp
Displays CLI tools version
.El
.Ss Nodes
.Bl -tag -width Ds
.\" ------------------------------------
.It Cm wait
.Pp
See
.Cm wait
in
.Xr rabbitmqctl 8
.El
.Ss Cluster
.Bl -tag -width Ds
.\" ------------------------------------
.It Cm cluster_status
.Pp
See
.Cm cluster_status
in
.Xr rabbitmqctl 8
.El
.Ss Users
.Bl -tag -width Ds
.\" ------------------------------------
.It Cm list_users
.Pp
See
.Cm list_users
in
.Xr rabbitmqctl 8
.El
.Ss Access Control
.Bl -tag -width Ds
.\" ------------------------------------
.It Cm list_permissions Op Fl p Ar vhost
.Pp
See
.Cm list_permissions
in
.Xr rabbitmqctl 8
.\" ------------------------------------
.It Cm list_topic_permissions Op Fl p Ar vhost
.Pp
See
.Cm list_topic_permissions
in
.Xr rabbitmqctl 8
.\" ------------------------------------
.It Cm list_user_permissions Ar username
.Pp
See
.Cm list_user_permissions
in
.Xr rabbitmqctl 8
.\" ------------------------------------
.It Cm list_user_topic_permissions Ar username
.Pp
See
.Cm list_user_topic_permissions
in
.Xr rabbitmqctl 8
.\" ------------------------------------
.It Cm list_vhosts Op Ar vhostinfoitem ...
.Pp
See
.Cm list_vhosts
in
.Xr rabbitmqctl 8
.El
.Ss Monitoring, observability and health checks
.Bl -tag -width Ds
.\" ------------------------------------
.It Cm alarms
.Pp
Lists resource alarms, if any, in the cluster.
.Pp
See
.Lk https://rabbitmq.com/alarms.html "RabbitMQ Resource Alarms guide"
to learn more.
.Pp
Example:
.Sp
.Dl rabbitmq-diagnostics alarms
.\" ------------------------------------
.It Cm certificates
.Pp
Displays the node certificates for every listener on target node that is configured to use TLS.
.Pp
Example:
.sp
.Dl rabbitmq-diagnostics certificates
.\" ------------------------------------
.It Cm check_alarms
.Pp
Health check that fails (returns with a non-zero code) if there are alarms
in effect on any of the cluster nodes.
.Pp
See
.Lk https://rabbitmq.com/alarms.html "RabbitMQ Resource Alarms guide"
to learn more.
.Pp
Example:
.Sp
.Dl rabbitmq-diagnostics check_alarms
.\" ------------------------------------
.It Cm check_certificate_expiration Oo Fl -unit Ar time_unit Oc Op Fl -within Ar seconds
.Pp
Checks the expiration date on the certificates for every listener on target node that is configured to use TLS.
Supported time units are:
.Bl -bullet
.It
days
.It
weeks
.It
months
.It
years
.El
.Pp
Example:
.Sp
.Dl rabbitmq-diagnostics check_certificate_expiration --unit weeks --within 6
.\" ------------------------------------
.It Cm check_local_alarms
.Pp
Health check that fails (returns with a non-zero code) if there are alarms
in effect on the target node.
.Pp
See
.Lk https://rabbitmq.com/alarms.html "RabbitMQ Resource Alarms guide"
to learn more.
.Pp
Example:
.Sp
.Dl rabbitmq-diagnostics check_local_alarms
.\" ------------------------------------
.It Cm check_port_connectivity
.Pp
Health check that fails (returns with a non-zero code) if any listener ports
on the target node cannot accept a new TCP connection opened by
.Nm
.Pp
The check only validates if a new TCP connection is accepted. It does not
perform messaging protocol handshake or authenticate.
.Pp
See
.Lk https://rabbitmq.com/networking.html "RabbitMQ Networking guide"
to learn more.
.Pp
Example:
.Sp
.Dl rabbitmq-diagnostics check_port_connectivity
.\" ------------------------------------
.It Cm check_port_listener Ar port
.Pp
Health check that fails (returns with a non-zero code) if the target node
is not listening on the specified port (there is no listener that
uses that port).
.Pp
See
.Lk https://rabbitmq.com/networking.html "RabbitMQ Networking guide"
to learn more.
.Pp
Example:
.Sp
.Dl rabbitmq-diagnostics check_port_listener 5672
.\" ------------------------------------
.It Cm check_protocol_listener Ar protocol
.Pp
Health check that fails (returns with a non-zero code) if the target node
does not have a listener for the specified protocol.
.Pp
See
.Lk https://rabbitmq.com/networking.html "RabbitMQ Networking guide"
to learn more.
.Pp
Example:
.Sp
.Dl rabbitmq-diagnostics check_protocol_listener mqtt
.\" ------------------------------------
.It Cm check_running
.Pp
Health check that fails (returns with a non-zero code) if the RabbitMQ
application is not running on the target node.
.Pp
If
.Cm rabbitmqctl(8)
was used to stop the application, this check will fail.
.Pp
Example:
.Sp
.Dl rabbitmq-diagnostics check_running
.\" ------------------------------------
.It Cm check_virtual_hosts
.Pp
Health check that checks if all vhosts are running in the target node
.Pp
Example:
.Sp
.Dl rabbitmq-diagnostics check_virtual_hosts --timeout 60
.\" ------------------------------------
.It Cm cipher_suites
.Pp
Lists cipher suites enabled by default. To list all available cipher suites, add the --all argument.
.Pp
Example:
.Sp
.Dl rabbitmq-diagnostics cipher_suites --format openssl --all
.\" ------------------------------------
.It Cm command_line_arguments
.Pp
Displays target node's command-line arguments and flags as reported by the runtime.
.Pp
Example:
.Sp
.Dl rabbitmq-diagnostics command_line_arguments -n rabbit@hostname
.\" ------------------------------------
.It Cm consume_event_stream Oo Fl -duration Ar seconds | Fl d Ar seconds Oc Oo Fl -pattern Ar pattern Oc Op Fl -timeout Ar milliseconds
.Pp
Streams internal events from a running node. Output is jq-compatible.
.Pp
Example:
.Sp
.Dl rabbitmq-diagnostics consume_event_stream -n rabbit@hostname --duration 20 --pattern "queue_.*"
.\" ------------------------------------
.It Cm discover_peers
.Pp
Runs a peer discovery on the target node and prints the discovered nodes, if any.
.Pp
See
.Lk https://rabbitmq.com/cluster-formation.html "RabbitMQ Cluster Formation guide"
to learn more.
.Pp
Example:
.Sp
.Dl rabbitmq-diagnostics discover_peers --timeout 60
.\" ------------------------------------
.It Cm environment
See
.Cm environment
in
.Xr rabbitmqctl 8
.\" ------------------------------------
.It Cm erlang_cookie_hash
.Pp
Outputs a hashed value of the shared secret used by the target node
to authenticate CLI tools and peers. The value can be compared with the hash
found in error messages of CLI tools.
.Pp
See
.Lk https://rabbitmq.com/clustering.html#erlang-cookie "RabbitMQ Clustering guide"
to learn more.
.Pp
Example:
.Sp
.Dl rabbitmq-diagnostics erlang_cookie_hash -q
.\" ------------------------------------
.It Cm erlang_version
.Pp
Reports target node's Erlang/OTP version.
.Pp
Example:
.Sp
.Dl rabbitmq-diagnostics erlang_version -q
.\" ------------------------------------
.It Cm is_booting
.Pp
Reports if RabbitMQ application is currently booting (not booted/running or stopped) on
the target node.
.Pp
Example:
.Sp
.Dl rabbitmq-diagnostics is_booting
.\" ------------------------------------
.It Cm is_running
.Pp
Reports if RabbitMQ application is fully booted and running (that is, not stopped) on
the target node.
.Pp
Example:
.Sp
.Dl rabbitmq-diagnostics is_running
.\" ------------------------------------
.It Cm list_bindings Oo Fl p Ar vhost Oc Op Ar bindinginfoitem ...
.Pp
See
.Cm list_bindings
in
.Xr rabbitmqctl 8
.\" ------------------------------------
.It Cm list_channels Op Ar channelinfoitem ...
.Pp
See
.Cm list_channels
in
.Xr rabbitmqctl 8
.\" ------------------------------------
.It Cm list_ciphers
.Pp
See
.Cm list_ciphers
in
.Xr rabbitmqctl 8
.\" ------------------------------------
.It Cm list_connections Op Ar connectioninfoitem ...
.Pp
See
.Cm list_connections
in
.Xr rabbitmqctl 8
.\" ------------------------------------
.It Cm list_consumers Op Fl p Ar vhost
.Pp
See
.Cm list_consumers
in
.Xr rabbitmqctl 8
.\" ------------------------------------
.It Cm list_exchanges Oo Fl p Ar vhost Oc Op Ar exchangeinfoitem ...
.Pp
See
.Cm list_exchanges
in
.Xr rabbitmqctl 8
.\" ------------------------------------
.It Cm list_hashes
.Pp
See
.Cm list_hashes
in
.Xr rabbitmqctl 8
.\" ------------------------------------
.It Cm list_queues Oo Fl p Ar vhost Oc Oo Fl -offline | Fl -online | Fl -local Oc Op Ar queueinfoitem ...
.Pp
See
.Cm list_queues
in
.Xr rabbitmqctl 8
.\" ------------------------------------
.It Cm list_unresponsive_queues Oc Oo Fl -local Oc Oo Fl -queue-timeout Ar milliseconds Oc Oo Ar column ... Oc Op Fl -no-table-headers
.Pp
See
.Cm list_unresponsive_queues
in
.Xr rabbitmqctl 8
.\" ------------------------------------
.It Cm listeners
.Pp
Lists listeners (bound sockets) on this node. Use this to inspect
what protocols and ports the node is listening on for client, CLI tool
and peer connections.
.Pp
See
.Lk https://rabbitmq.com/networking.html "RabbitMQ Networking guide"
to learn more.
.Pp
Example:
.Sp
.Dl rabbitmq-diagnostics listeners
.\" ------------------------------------
.It Cm log_tail Fl -number Ar number | Fl N Ar number  Op Fl -timeout Ar milliseconds
.Pp
Prints the last N lines of the log on the node
.Pp
Example:
.Sp
.Dl rabbitmq-diagnostics log_tail -number 100
.\" ------------------------------------
.It Cm log_tail_stream Oo Fl -duration Ar seconds | Fl d Ar seconds Oc Op Fl -timeout Ar milliseconds
.Pp
Streams logs from a running node for a period of time
.Pp
Example:
.Sp
.Dl rabbitmq-diagnostics log_tail_stream --duration 60
.\" ------------------------------------
.It Cm maybe_stuck
.Pp
Periodically samples stack traces of all Erlang processes
("lightweight threads") on the node. Reports the processes for which
stack trace samples are identical.
.Pp
Identical samples may indicate that the process is not making any progress
but is not necessarily an indication of a problem.
.Pp
Example:
.Sp
.Dl rabbitmq-diagnostics maybe_stuck -q
.\" ------------------------------------
.It Cm memory_breakdown Op Fl -unit Ar memory_unit
.Pp
Displays node's memory usage by category.
Supported memory units are:
.Bl -bullet
.It
bytes
.It
megabytes
.It
gigabytes
.It
terabytes
.El
.Pp
See
.Lk https://rabbitmq.com/memory-use.html "RabbitMQ Memory Use guide"
to learn more.
.Pp
Example:
.sp
.Dl rabbitmq-diagnostics memory_breakdown --unit gigabytes
.\" ------------------------------------
.It Cm observer Op Fl -interval Ar seconds
.Pp
Starts a CLI observer interface on the target node
.Pp
Example:
.Sp
.Dl rabbitmq-diagnostics observer --interval 10
.\" ------------------------------------
.It Cm ping
.Pp
Most basic health check. Succeeds if target node (runtime) is running
and
.Nm
can authenticate with it successfully.
.\" ------------------------------------
.It Cm report
.Pp
See
.Cm report
in
.Xr rabbitmqctl 8
.\" ------------------------------------
.It Cm runtime_thread_stats Op Fl -sample-interval Ar interval
.Pp
Performs sampling of runtime (kernel) threads' activity for
.Ar interval
seconds and reports it.
.Pp
For this command to work, Erlang/OTP on the target node must be compiled with
microstate accounting support and have the runtime_tools package available.
.Pp
Example:
.Sp
.Dl rabbitmq-diagnostics runtime_thread_stats --sample-interval 15
.\" ------------------------------------
.It Cm schema_info Oo Fl -no_table_headers Oc Oo Ar column ... Oc Op Fl -timeout Ar milliseconds
.Pp
See
.Cm schema_info
in
.Xr rabbitmqctl 8
.\" ------------------------------------
.It Cm server_version
.Pp
Reports target node's version.
.Pp
Example:
.Sp
.Dl rabbitmq-diagnostics server_version -q
.\" ------------------------------------
.It Cm status
.Pp
See
.Cm status
in
.Xr rabbitmqctl 8
.\" ------------------------------------
.It Cm tls_versions
.Pp
Lists all TLS versions supported by the runtime on the target node.
Note that RabbitMQ can be configured to only accept a subset of those
versions, for example, SSLv3 is disabled by default.
.Pp
See
.Lk https://rabbitmq.com/ssl.html "RabbitMQ TLS guide"
to learn more.
.Pp
Example:
.Sp
.Dl rabbitmq-diagnostics tls_versions -q
.El
.Ss Parameters
.Bl -tag -width Ds
.\" ------------------------------------
.It Cm list_global_parameters
.Pp
See
.Cm list_global_parameters
in
.Xr rabbitmqctl 8
.\" ------------------------------------
.It Cm list_parameters Op Fl p Ar vhost
.Pp
See
.Cm list_parameters
in
.Xr rabbitmqctl 8
.El
.Ss Policies
.Bl -tag -width Ds
.\" ------------------------------------
.It Cm list_operator_policies Op Fl p Ar vhost
.Pp
See
.Cm list_operator_policies
in
.Xr rabbitmqctl 8
.\" ------------------------------------
.It Cm list_policies Op Fl p Ar vhost
.Pp
See
.Cm list_policies
in
.Xr rabbitmqctl 8
.\" ------------------------------------
.El
.Ss Virtual hosts
.Bl -tag -width Ds
.\" ------------------------------------
.It Cm list_vhost_limits Oo Fl -vhost Ar vhost Oc Oo Fl -global Oc Op Fl -no-table-headers
.Pp
See
.Cm list_vhost_limits
in
.Xr rabbitmqctl 8
.El
.Ss Node configuration
.Bl -tag -width Ds
.\" ------------------------------------
.It Cm log_location Oo Fl -all | Fl a Oc Op Fl -timeout Ar milliseconds
.Pp
Shows log file location(s) on target node
.Pp
Example:
.Sp
.Dl rabbitmq-diagnostics log_location -a
.El
.Ss Feature flags
.Bl -tag -width Ds
.\" ------------------------------------
.It Cm list_feature_flags Oo Ar column ... Oc Op Fl -timeout Ar milliseconds
.Pp
See
.Cm list_feature_flags
in
.Xr rabbitmqctl 8
.El
.Ss Queues
.Bl -tag -width Ds
.\" ------------------------------------
.It Cm quorum_status Ar queue Op Fl -vhost Ar vhost
.Pp
See
.Cm quorum_status
in
.Xr rabbitmq-queues 8
.It Cm check_if_node_is_mirror_sync_critical
.Pp
See
.Cm check_if_node_is_mirror_sync_critical
in
.Xr rabbitmq-queues 8
.It Cm check_if_node_is_quorum_critical
.Pp
See
.Cm check_if_node_is_quorum_critical
in
.Xr rabbitmq-queues 8
.\" ------------------------------------------------------------------
.Sh SEE ALSO
.\" ------------------------------------------------------------------
.Xr rabbitmqctl 8 ,
.Xr rabbitmq-server 8 ,
.Xr rabbitmq-queues 8 ,
.Xr rabbitmq-upgrade 8 ,
.Xr rabbitmq-service 8 ,
.Xr rabbitmq-env.conf 5 ,
.Xr rabbitmq-echopid 8
.\" ------------------------------------------------------------------
.Sh AUTHOR
.\" ------------------------------------------------------------------
.An The RabbitMQ Team Aq Mt info@rabbitmq.com