rabbitmq-diagnostics
Diagnose RabbitMQ node health and state
TLDR
List resource alarms
List node certificates
Check if RabbitMQ is running on the specified node
Run peer discovery
List listeners (bound sockets)
Print the last n log lines on the specified node
SYNOPSIS
rabbitmq-diagnostics <subcommand> [<subcommand_options>]
[--node <node_name>]
[--longnames]
[--silent]
[--wait]
PARAMETERS
status
Displays the status of the local RabbitMQ node, including OS, Erlang, memory usage, open files, network connections, and running applications.
cluster_status
Provides a summary of the RabbitMQ cluster, including cluster members, their health, defined policies, and queue master locations.
environment
Shows the effective environment variables and their values used by the RabbitMQ node at startup.
erlang_cookie_paths
Lists the possible locations where the Erlang cookie file might be found, which is crucial for inter-node communication and authentication.
node_health_check
Performs a basic health check on the RabbitMQ node, verifying its operational state and readiness.
observer_cli
Starts an Erlang Observer CLI session connected to the RabbitMQ node for detailed runtime inspection of Erlang processes.
listen_ports
Displays the network ports the RabbitMQ node is currently listening on for client and inter-node communication.
log_config
Shows the effective logging configuration for the RabbitMQ node, including log levels and destinations.
schema_info
Provides information about the RabbitMQ internal database schema, including file locations and versions.
config_info
Displays the effective configuration files, directories, and other system paths used by RabbitMQ.
net_tick_time
Shows the Erlang net_tick_time value, which affects how often Erlang nodes check connectivity with each other.
--node <node_name>
Specifies the target RabbitMQ node (e.g., rabbit@hostname). Defaults to the local node. Can be used with most subcommands to target remote nodes.
--longnames
Forces the use of long node names (e.g., rabbit@host.fqdn) instead of short names, which is important in mixed DNS environments.
--silent
Suppresses output for commands that might normally print to stdout (use with caution as it hides diagnostic information).
--wait
Makes the command wait for the target RabbitMQ node to be running and fully started before executing the specified subcommand.
DESCRIPTION
The rabbitmq-diagnostics command is a powerful utility for troubleshooting, monitoring, and inspecting the state of RabbitMQ nodes and clusters. Unlike rabbitmqctl, many of its commands can operate even if the RabbitMQ application itself is not fully started, making it invaluable for diagnosing issues with unresponsive or partially booting nodes. It provides detailed insights into node health, configuration, runtime metrics, network connectivity, Erlang environment, and cluster topology. Administrators and support personnel frequently use this tool to gather information essential for debugging and maintaining RabbitMQ deployments, often as the first step when a node exhibits unexpected behavior or fails to join a cluster properly.
CAVEATS
The command requires correct file system permissions to access RabbitMQ's data directory, log files, and the Erlang cookie. When targeting remote nodes or using a non-standard Erlang cookie, ensure the cookie is correctly configured and accessible in the expected locations. Some subcommands (e.g., cluster_status) still require the RabbitMQ application to be running, while others (e.g., erlang_cookie_paths) can run earlier in the startup process. Network connectivity is essential for communicating with remote cluster members.
USAGE CONTEXT
Use rabbitmq-diagnostics primarily when you need to gather information about a RabbitMQ node or cluster, especially if the node is not responding to rabbitmqctl commands or is failing to start. It's often the first tool to reach for when a node exhibits unexpected behavior, is unreachable, or has startup issues. For routine administration of a healthy and fully operational cluster, rabbitmqctl remains the go-to command.
ERLANG COOKIE IMPORTANCE
For rabbitmq-diagnostics to communicate with a RabbitMQ node (local or remote), it typically requires access to the Erlang cookie. This cookie acts as a shared secret for authentication between Erlang nodes. If the command fails with 'badarg', 'nodedown', or similar errors related to node communication, verifying the Erlang cookie's presence and correct permissions is often the first troubleshooting step. The correct cookie path can be identified using the erlang_cookie_paths subcommand.
HISTORY
rabbitmq-diagnostics was introduced to provide a more robust and granular set of tools for troubleshooting RabbitMQ nodes. While rabbitmqctl serves as the primary administrative interface, it often requires the RabbitMQ application to be fully operational. rabbitmq-diagnostics was specifically designed to gather critical information even when a node is partially started, unresponsive, or experiencing issues, making it an essential tool for deep-dive diagnostics and support scenarios. Its capabilities have expanded with successive RabbitMQ versions to cover more aspects of node and cluster health.
SEE ALSO
rabbitmqctl(8), rabbitmq-plugins(8), epmd(1)


