Linux command
rabbitmq-diagnostics 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Check that the local node is running
rabbitmq-diagnostics check_running
Print cluster status
rabbitmq-diagnostics cluster_status
Check for resource alarms
rabbitmq-diagnostics check_alarms
Memory usage breakdown
rabbitmq-diagnostics memory_breakdown
Check listener ports
rabbitmq-diagnostics check_port_connectivity
Check virtual hosts
rabbitmq-diagnostics check_virtual_hosts
Output as JSON
rabbitmq-diagnostics status --formatter json
说明
rabbitmq-diagnostics provides health checks and observability commands for RabbitMQ nodes and clusters. It is the recommended tool for monitoring scripts and Kubernetes probes, replacing many ad-hoc uses of rabbitmqctl. Health checks return non-zero exit codes when a check fails, making them easy to wire into liveness/readiness probes and CI gates. The "deeper" checks (e.g. check_alarms) take longer and exercise more of the node, so use check_running for high-frequency probes and reserve heavier checks for less-frequent monitoring.
参数
- -n _node_
- Target node name (default: rabbit@$(hostname)).
- -l, --longnames
- Use fully-qualified node names (FQDN).
- -t _timeout_
- Operation timeout, in seconds.
- --formatter _format_
- Output format: table (default), json, csv, erlang.
- -q, --quiet
- Suppress informational headers and status lines.
- -s, --silent
- No output for successful checks (useful in monitoring).
FAQ
What is the rabbitmq-diagnostics command used for?
rabbitmq-diagnostics provides health checks and observability commands for RabbitMQ nodes and clusters. It is the recommended tool for monitoring scripts and Kubernetes probes, replacing many ad-hoc uses of rabbitmqctl. Health checks return non-zero exit codes when a check fails, making them easy to wire into liveness/readiness probes and CI gates. The "deeper" checks (e.g. check_alarms) take longer and exercise more of the node, so use check_running for high-frequency probes and reserve heavier checks for less-frequent monitoring.
How do I run a basic rabbitmq-diagnostics example?
Run `rabbitmq-diagnostics check_running` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -n _node_ do in rabbitmq-diagnostics?
Target node name (default: rabbit@$(hostname)).