@@ -9,54 +9,18 @@ defmodule RabbitMQ.CLI.Ctl.Commands.NodeHealthCheckCommand do
9
9
10
10
@ behaviour RabbitMQ.CLI.CommandBehaviour
11
11
12
- @ default_timeout 70_000
13
-
14
12
def scopes ( ) , do: [ :ctl , :diagnostics ]
15
13
use RabbitMQ.CLI.Core.AcceptsDefaultSwitchesAndTimeout
16
14
17
15
def merge_defaults ( args , opts ) do
18
- timeout =
19
- case opts [ :timeout ] do
20
- nil -> @ default_timeout
21
- :infinity -> @ default_timeout
22
- other -> other
23
- end
24
-
25
- { args , Map . merge ( opts , % { timeout: timeout } ) }
16
+ { args , opts }
26
17
end
27
18
28
19
use RabbitMQ.CLI.Core.AcceptsNoPositionalArguments
29
20
use RabbitMQ.CLI.Core.RequiresRabbitAppRunning
30
21
31
- def run ( [ ] , % { node: node_name , timeout: timeout } ) do
32
- case :rabbit_misc . rpc_call ( node_name , :rabbit_health_check , :node , [ node_name , timeout ] ) do
33
- :ok ->
34
- :ok
35
-
36
- true ->
37
- :ok
38
-
39
- { :badrpc , _ } = err ->
40
- err
41
-
42
- { :error_string , error_message } ->
43
- { :healthcheck_failed , error_message }
44
-
45
- { :node_is_ko , error_message , _exit_code } ->
46
- { :healthcheck_failed , error_message }
47
-
48
- other ->
49
- other
50
- end
51
- end
52
-
53
- def output ( :ok , _ ) do
54
- { :ok , "Health check passed" }
55
- end
56
-
57
- def output ( { :healthcheck_failed , message } , _ ) do
58
- { :error , RabbitMQ.CLI.Core.ExitCodes . exit_software ( ) ,
59
- "Error: health check failed. Message: #{ message } " }
22
+ def run ( [ ] , _opts ) do
23
+ :ok
60
24
end
61
25
62
26
use RabbitMQ.CLI.DefaultOutput
@@ -72,17 +36,14 @@ defmodule RabbitMQ.CLI.Ctl.Commands.NodeHealthCheckCommand do
72
36
def help_section ( ) , do: :deprecated
73
37
74
38
def description ( ) do
75
- "DEPRECATED. Performs intrusive, opinionated health checks on a fully booted node . " <>
76
- "See https://www.rabbitmq.com/monitoring.html#health-checks instead "
39
+ "DEPRECATED. This command is a no-op . " <>
40
+ "See https://www.rabbitmq.com/monitoring.html#health-checks"
77
41
end
78
42
79
- def banner ( _ , % { node: node_name , timeout: timeout } ) do
43
+ def banner ( _ , _opts ) do
80
44
[
81
- "This command is DEPRECATED and will be removed in a future version." ,
82
- "It performs intrusive, opinionated health checks and requires a fully booted node." ,
83
- "Use one of the options covered in https://www.rabbitmq.com/monitoring.html#health-checks instead." ,
84
- "Timeout: #{ trunc ( timeout / 1000 ) } seconds ..." ,
85
- "Checking health of node #{ node_name } ..."
45
+ "This command is DEPRECATED and is a no-op. It will be removed in a future version. " ,
46
+ "Use one of the options covered in https://www.rabbitmq.com/monitoring.html#health-checks instead."
86
47
]
87
48
end
88
49
end
0 commit comments