4
4
##
5
5
## Copyright (c) 2007-2025 VMware, Inc. or its affiliates. All rights reserved.
6
6
7
- defmodule RabbitMQ.CLI.Diagnostics.Commands.LeaderHealthCheckCommand do
7
+ defmodule RabbitMQ.CLI.Diagnostics.Commands.CheckForQuorumQueuesWithoutAnElectedLeaderCommand do
8
8
alias RabbitMQ.CLI.Core.DocGuide
9
9
10
10
@ behaviour RabbitMQ.CLI.CommandBehaviour
11
11
12
12
import RabbitMQ.CLI.Core.Platform , only: [ line_separator: 0 ]
13
13
14
- def switches ( ) , do: [ global : :boolean ]
14
+ def switches ( ) , do: [ across_all_vhosts : :boolean ]
15
15
16
16
def scopes ( ) , do: [ :diagnostics ]
17
17
18
18
def merge_defaults ( args , opts ) do
19
- { args , Map . merge ( % { global : false , vhost: "/" } , opts ) }
19
+ { args , Map . merge ( % { across_all_vhosts : false , vhost: "/" } , opts ) }
20
20
end
21
21
22
22
use RabbitMQ.CLI.Core.AcceptsOnePositionalArgument
23
23
use RabbitMQ.CLI.Core.RequiresRabbitAppRunning
24
24
25
- def run ( [ pattern ] = _args , % { node: node_name , vhost: vhost , global: global_opt } ) do
26
- vhost = if global_opt , do: :global , else: vhost
25
+ def run ( [ pattern ] = _args , % { node: node_name , vhost: vhost , across_all_vhosts: across_all_vhosts_opt } ) do
26
+ vhost = if across_all_vhosts_opt , do: :across_all_vhosts , else: vhost
27
27
28
28
case :rabbit_misc . rpc_call ( node_name , :rabbit_quorum_queue , :leader_health_check , [ pattern , vhost ] ) do
29
29
[ ] ->
@@ -73,13 +73,13 @@ defmodule RabbitMQ.CLI.Diagnostics.Commands.LeaderHealthCheckCommand do
73
73
def formatter ( ) , do: RabbitMQ.CLI.Formatters.PrettyTable
74
74
75
75
def usage ( ) do
76
- "leader_health_check [--vhost <vhost>] [--global ] <pattern>"
76
+ "leader_health_check [--vhost <vhost>] [--across-all-vhosts ] <pattern>"
77
77
end
78
78
79
79
def usage_additional do
80
80
[
81
81
[ "<pattern>" , "regular expression pattern used to match quorum queues" ] ,
82
- [ "--global " , "run leader health check for all queues in all virtual hosts on the node" ]
82
+ [ "--across-all-vhosts " , "run leader health check for all queues in all virtual hosts on the node" ]
83
83
]
84
84
end
85
85
@@ -93,11 +93,11 @@ defmodule RabbitMQ.CLI.Diagnostics.Commands.LeaderHealthCheckCommand do
93
93
94
94
def description ( ) , do: "Checks availability and health status of quorum queue leaders"
95
95
96
- def banner ( [ name ] , % { global : true } ) ,
97
- do: "Checking availability and health status of leaders for quorum queues matching #{ name } in all vhosts ..."
96
+ def banner ( [ name ] , % { across_all_vhosts : true } ) ,
97
+ do: "Checking availability and health status of leaders for quorum queues matching ' #{ name } ' in all vhosts ..."
98
98
99
99
def banner ( [ name ] , % { vhost: vhost } ) ,
100
- do: "Checking availability and health status of leaders for quorum queues matching #{ name } in vhost #{ vhost } ..."
100
+ do: "Checking availability and health status of leaders for quorum queues matching ' #{ name } ' in vhost #{ vhost } ..."
101
101
102
102
def queue_lines ( qs ) do
103
103
for q <- qs , do: "Leader for #{ q [ "readable_name" ] } is unhealthy and unavailable"
0 commit comments