RabbitMQ internals monitoring by Zabbix

Continuation of extending zabbix-agent to monitor internals of applications. Now it’s a RabbitMQ turn:

What’s supported:

  • File descriptors, Memory, Sockets watermarks monitoring
  • Low level discovery of vhosts/queues
  • Monitoring for messages, unack, consumers per queue
  • Triggers for important counters
  • Data sent in chunks, not one by one, using zabbix traps

Installation:

  1. Save this as /etc/zabbix/zabbix_agentd.conf.d/rabbitmq.conf:
    # rabbitmq[server,uptime] will trigger trap sending
    # run '/etc/zabbix/rabbitmq.py server uptime debug' - to debug trap sending
    UserParameter=rabbitmq[*],/etc/zabbix/rabbitmq.py $1 $2
    
  2. Which will call this data-getter:
    /etc/zabbix/rabbitmq.py
  3. Import template
    template_app_rabbitmq.xml

Notes:

  • Queues statistic is per-cluster and not per-server. This mean that having cluster of three nodes, all of them will have equal graphs for queues. So, there is line 31 in rabbitmq.py which states:
if not socket.gethostname().endswith("-1"): return []  #only discover queues on first node

We have naming convention like node-1, node-2 - and discovering queues only on first node. Remove/modify this line if it is not your case

  • Data about queues is sent as zabbix traps to lower bandwidth and system load.
    To troubleshoot zabbix_sender run script manually as:
/etc/zabbix/rabbitmq.py server uptime debug
Related content: