44##
55## Copyright (c) 2007-2025 VMware, Inc. or its affiliates. All rights reserved.
66
7- defmodule RabbitMQ.CLI.Diagnostics.Commands.LeaderHealthCheckCommand do
7+ defmodule RabbitMQ.CLI.Diagnostics.Commands.CheckForQuorumQueuesWithoutAnElectedLeaderCommand do
88 alias RabbitMQ.CLI.Core.DocGuide
99
1010 @ behaviour RabbitMQ.CLI.CommandBehaviour
1111
1212 import RabbitMQ.CLI.Core.Platform , only: [ line_separator: 0 ]
1313
14- def switches ( ) , do: [ global : :boolean ]
14+ def switches ( ) , do: [ across_all_vhosts : :boolean ]
1515
1616 def scopes ( ) , do: [ :diagnostics ]
1717
1818 def merge_defaults ( args , opts ) do
19- { args , Map . merge ( % { global : false , vhost: "/" } , opts ) }
19+ { args , Map . merge ( % { across_all_vhosts : false , vhost: "/" } , opts ) }
2020 end
2121
2222 use RabbitMQ.CLI.Core.AcceptsOnePositionalArgument
2323 use RabbitMQ.CLI.Core.RequiresRabbitAppRunning
2424
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
2727
2828 case :rabbit_misc . rpc_call ( node_name , :rabbit_quorum_queue , :leader_health_check , [ pattern , vhost ] ) do
2929 [ ] ->
@@ -73,13 +73,13 @@ defmodule RabbitMQ.CLI.Diagnostics.Commands.LeaderHealthCheckCommand do
7373 def formatter ( ) , do: RabbitMQ.CLI.Formatters.PrettyTable
7474
7575 def usage ( ) do
76- "leader_health_check [--vhost <vhost>] [--global ] <pattern>"
76+ "leader_health_check [--vhost <vhost>] [--across-all-vhosts ] <pattern>"
7777 end
7878
7979 def usage_additional do
8080 [
8181 [ "<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" ]
8383 ]
8484 end
8585
@@ -93,11 +93,11 @@ defmodule RabbitMQ.CLI.Diagnostics.Commands.LeaderHealthCheckCommand do
9393
9494 def description ( ) , do: "Checks availability and health status of quorum queue leaders"
9595
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 ..."
9898
9999 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 } ..."
101101
102102 def queue_lines ( qs ) do
103103 for q <- qs , do: "Leader for #{ q [ "readable_name" ] } is unhealthy and unavailable"
0 commit comments