Zabbix agent extension for monitoring RabbitMQ server
This extension for monitoring RabbitMQ in standalone or cluster mode.
- The
zabbix_sender
is no longer needed - Auto discovery all queues in existing vhost's (LLD)
- Triggers on discovered queues
- Configurable triggers of queue max capacity by macro
- consumers
- memory usage
- messages
- ready messages
- unacknowledged messages
- deliver rate
- deliver_get rate
- deliver_no_ack rate
- get rate
- get_no_ack rate
- publish rate
- redeliver rate
infinity or very long redeliver
- it happens when some message/s don't ACKed by a consumer and they always move back to queue. It's not always a bad situation but for us, it means a problem with messages or consumer.zero deliver rate when queue not empty
- I think this is also a bad situation when you have some messages in the queue but have not anyone consumer for handle that messages
- Enabled RabbitMQ management plugin https://www.rabbitmq.com/management.html
- Golang >= 1.11 (please refer to your Linux distribution documentation for Golang installation)
git clone https://github.com/zarplata/zabbix-agent-extension-rabbitmq.git
cd zabbix-agent-extension-rabbitmq
./build-archlinux.sh
sudo pacman -U *.tar.xz --noconfirm
systemctl restart zabbix-agent
git clone https://github.com/zarplata/zabbix-agent-extension-rabbitmq.git
cd zabbix-agent-extension-rabbitmq
make
sudo cp .out/zabbix-agent-extension-rabbitmq /usr/bin/
sudo cp zabbix-agent-extension-rabbitmq.conf /etc/zabbix/zabbix_agentd.conf.d/
systemctl restart zabbix-agent
yum install go -y
# Create directory for development
mkdir -p /home/USERNAME/golang/{pkg,src,bin}
# export GOPATH variable
export GOPATH="/home/USERNAME/golang"
export PATH=$PATH:$GOPATH/bin
# Clone the repository
cd /tmp/
git clone https://github.com/zarplata/zabbix-agent-extension-rabbitmq.git
# Build
cd zabbix-agent-extension-rabbitmq/
make
# Install
cp .out/zabbix-agent-extension-rabbitmq /usr/bin/
cp zabbix-agent-extension-rabbitmq.conf /etc/zabbix/zabbix_agentd.d/
systemctl restart zabbix-agent.service
Be note!
- You should add a global macro (Administration -> General -> Macros) -
{$ZABBIX_SERVER_IP}
with your Zabbix server IP. - For both installation you also should import
template_app_rabbitmq_service.xml
template into Zabbix server. - Zabbix agent extensible directory path depends on Linux distribution and can be mismatch with the directory in this manual
{$RABBITMQ_PORT}
- RabbitMQ server port [default: 5672]{$RABBITMQ_MGMT_ADDRESS}
- RabbitMQ management address [default: http://127.0.0.1:15672]{$RABBITMQ_CA_PATH}
- Path to custom CA. It may use if RabbitMQ runs management plugin over HTTPS with self-signed certificate.{$RABBITMQ_USER}
- RabbitMQ management username [default: guest] http://www.rabbitmq.com/access-control.html#loopback-users{RABBITMQ_PASSWORD}
- RabbitMQ management user password [default: guest] http://www.rabbitmq.com/access-control.html#loopback-users{$MAX_MESSAGES}
- Max numbers of messages for all queues [default: 1000000] For customize various values for different queues see description below.
You can customize Too much messages in {#QUEUENAME}
trigger, by setting a message threshold for each queue.
By default template has predefined macro {$MAX_MESSAGES} => 1000000
so for each discovered queue will created trigger with a threshold - 1000000
if that value so big or so small you can change it or make separate macro only for interested queue for example - macro {$MAX_MESSAGES:"/mysuperqueue"} => 100
set threshold 100
for mysuperqueue
in /
vhost, so for different vhost you should just change /
to your vhost name, for example - {$MAX_MESSAGES:"mycustomvhostmysuperqueue"} => 100
This feature (User macro context) is described in this section - https://www.zabbix.com/documentation/3.4/manual/config/macros/usermacros
If you have cluster you should known that each metric of queue will be the same on each node, so you will receive so many alerts, how many nodes you have in the cluster because extension should be installed on all nodes. To avoid this behave and have only one alert and have only one aggregate metric this extension use feature of Zabbix server - aggregate checks
https://www.zabbix.com/documentation/3.4/manual/config/items/itemtypes/aggregate
So, you should create special host group in your Zabbix server, for example - rabbitmq_aggregate
and add each node to this group, then you can add macro to one of cluster node (don't add macro on each node!!!) - {$GROUPNAME} = rabbitmq_aggregate
, after that you can see new items and triggers only on node with defined macro.