- 下载二进制包
wget https://github.com/kbudde/rabbitmq_exporter/releases/download/v1.0.0-RC5/rabbitmq_exporter-1.0.0-RC5.linux-amd64.tar.gz
tar xf rabbitmq_exporter-1.0.0-RC5.linux-amd64.tar.gz
mv rabbitmq_exporter-1.0.0-RC5.linux-amd64/rabbitmq_exporter /usr/local/bin
- 创建用户
useradd -M -s /sbin/nologin prometheus
- 创建服务
cat <<EOF>> /usr/lib/systemd/system/rabbitmq_exporter.service
[Unit]
Description=rabbitmq_exporter
Documentation=https://prometheus.io/
After=network.target
[Service]
Type=simple
User=prometheus
DefaultEnvironment='RABBIT_USER=guest RABBIT_PASSWORD=guest OUTPUT_FORMAT=JSON PUBLISH_PORT=9419 RABBIT_URL=http://localhost:15672'
ExecStart=/usr/local/bin/rabbitmq_exporter
Restart=on-failure
[Install]
WantedBy=multi-user.target
- 启动服务
systemctl enable rabbitmq_exporter && systemctl start rabbitmq_exporter
- 配置
prometheue.yml
...
- job_name: 'rabbitmq'
static_configs:
- targets:
- rabbitmq:9419
- 导入模版
https://gitee.com/llmgo/dashboards/raw/master/prometheus_rabbitmq.json
网友评论