下载 rabbitmq_exporter-0.29.0.linux-amd64.tar.gz 这个包, 下载地址:
https://github.com/kbudde/rabbitmq_exporter/releases
tar xf rabbitmq_exporter-0.29.0.linux-amd64.tar.gz -C /opt/
cd /opt/rabbitmq_exporter-0.29.0.linux-amd64
启动命令就1行:
RABBIT_USER=guest RABBIT_PASSWORD=guest OUTPUT_FORMAT=JSON PUBLISH_PORT=9099 RABBIT_URL=http://192.168.2.4:15672 nohup ./rabbitmq_exporter &
告警规则
groups:
- name: Rabbitmq
rules:
- alert: Rabbitmq-down
expr: rabbitmq_up{job='prd_rabbitmq'} != 1
labels:
status: WARN
team: Rabbitmq_monitor
annotations:
description: "Instance: {{ $labels.instance }} is Down ! ! !"
value: '{{ $value }}'
summary: "The host node is down"
- name: Rabbitmq disk free limit
rules:
- alert: Rabbitmq disk free limit status
expr: rabbitmq_node_disk_free{job='RabbitMQ'} / 1024 / 1024 <= rabbitmq_node_disk_free_limit{job='RabbitMQ'} / 1024 / 1024 + 200
labels:
status: WARN
team: Rabbitmq_monitor
annotations:
description: "Instance: {{ $labels.instance }} the rmq free disk is to low ! ! !"
value: '{{ $value }} MB'
summary: "The rmq free disk too low"
标签:exporter,tar,rabbitmq,Alertmanager,Rabbitmq,RABBIT,linux,告警
From: https://www.cnblogs.com/zmh520/p/15638056.html