open-falcon (一):监控rabbitmq

2018-02-06 19:39:00
aolens
原创
473

Github地址:

https://github.com/iambocai/falcon-monit-scripts/tree/master/redis


安装rabbitmq:

git clone https://github.com/iambocai/falcon-monit-scripts.git
cd /home/falcon/src/github.com/open-falcon/
mv falcon-monit-script/rabbitmq ./



汇报字段

---------------------------------------------------------------------------------
| key | tag | type | note |
|-------------------|--------------------|-------------------|-------------------|
rabbitmq.messages_ready|name(Queue名字)	|GAUGE	|队列中处于等待被消费状态消息数|
rabbitmq.messages_unacknowledged|name(Queue名字)	|GAUGE	|队列中处于消费中状态的消息数|
rabbitmq.messages_total|name(Queue名字)	|GAUGE	|队列中所有未完成消费的消息数,等于messages_ready+messages_unacknowledged|
rabbitmq.ack_rate|name(Queue名字)	|GAUGE	|消费者ack的速率|
rabbitmq.deliver_rate|name(Queue名字)	|GAUGE	|deliver的速率|
rabbitmq.deliver_get_rate|name(Queue名字)	|GAUGE	|deliver_get的速率|
rabbitmq.publish_rate|name(Queue名字)	|GAUGE	|publish的速率|



修改:vim rabbitmq-monitor.py
request = urllib2.Request("http://127.0.0.1:15672/api/queues")
base64string = base64.b64encode('guest:password') #正确的账号密码

添加到定时任务中去
crontab -e
* * * * * /usr/bin/python /home/falcon/src/github.com/open-falcon/rabbitmq/rabbitmq-monitor.py