A description of the application scenario
The online business uses RABBITMQ as the message queue middleware, so it is important to monitor the RABBITMQ as an OPS person, and this article explains how to monitor rabbitmq from beginning to end using Zabbix.
Two RABBITMQ monitoring points
RABBITMQ officially provides two ways to manage and monitor RABBITMQ.
1. Using RABBITMQCTL to manage and monitor
Usage:
Rabbitmqctl [-n <node>] [-Q] <command> [<command Options>]
Viewing virtual Hosts
# Rabbitmqctl List_vhosts
View queues
# Rabbitmqctl List_queues
View Exchanges
# Rabbitmqctl List_exchanges
View User
# Rabbitmqctl List_users
View Connections
# Rabbitmqctl List_connections
View consumer Information
# Rabbitmqctl List_consumers
View environment variables
# RABBITMQCTL Environment
To view an unconfirmed queue
# rabbitmqctl List_queues name messages_unacknowledged
View memory usage for a single queue
# RABBITMQCTL list_queues Name Memory
View ready-to-prepare queues
# rabbitmqctl List_queues name Messages_ready
2. Use the RABBITMQ management plugin to monitor and manage
Turn on the management plugin
# Rabbitmq-plugins Enable Rabbitmq_management
http://172.28.2.157:15672/
You can see the status of RABBITMQ by visiting this URL.
Http://172.28.2.157:15672/cli/rabbitmqadmin
Download Rabbitmqadmin management Tools
Get Vhost List
# curl-i-U guest:guest http://localhost:15672/api/vhosts
Get a list of channels, limit the display format
# curl-i-u guest:guest "Http://localhost:15672/api/channels?sort=message_stats.publish_details.rate&sort_ Reverse=true&columns=name,message_stats.publish_details.rate,message_stats.deliver_get_details.rate "
Three write the monitoring script and add the Zabbix configuration file
Four Add Zabbix monitoring templates
Reference Documentation:
Http://blog.thomasvandoren.com/monitoring-rabbitmq-queues-with-zabbix.html
Http://www.rabbitmq.com/how.html#management
Https://github.com/alfss/zabbix-rabbitmq
Https://cdn.rawgit.com/rabbitmq/rabbitmq-management/rabbitmq_v3_6_0/priv/www/api/index.html
Https://github.com/jasonmcintosh/rabbitmq-zabbix
Http://chase-seibert.github.io/blog/2011/07/01/checking-rabbitmq-queue-sizeage-with-nagios.html
This article is from the Linux SA John blog, so be sure to keep this source http://john88wang.blog.51cto.com/2165294/1745824
Use Zabbix to monitor RABBITMQ