RabbitMQ Zabbix 监控
-
copy
api.py
list_rabbit_nodes.sh
list_rabbit_queues.sh
list_rabbit_shovels.sh
rabbitmq-status.sh
共计5个脚本到 /usr/local/zabbix327/bin ,并对上述文件增加可执行权限. -
配置 zabbix agent 配置文件:
UserParameter=rabbitmq.discovery_queues,/usr/local/zabbix327/bin/list_rabbit_queues.sh
UserParameter=rabbitmq.discovery_shovels,/usr/local/zabbix327/bin/list_rabbit_shovels.sh
UserParameter=rabbitmq.discovery_nodes,/usr/local/zabbix327/bin/list_rabbit_nodes.sh
UserParameter=rabbitmq[*],/usr/local/zabbix327/bin/rabbitmq-status.sh $1 $2 $3 -
在
/usr/local/zabbix327/bin/
新增文件.rab.auth
内容如下:USERNAME=newadmin
PASSWORD=s0m3p4ssw0rd
CONF=/usr/local/zabbix327/etc/zabbix_agentd.conf
LOGLEVEL=INFO
LOGFILE=/tmp/zabbix_rabbitmq_zabbix.log
PORT=15672 -
测试:
# /usr/local/zabbix327/bin/list_rabbit_queues.sh
-
重启zabbix agentd
-
导入模板:
rabbitmq.template.xml
对原模板进行了部分修改可以下载:RabbitTemplate