
| 系统 | 安装 | Grafana | download |
| Windows | 参考 | 图形生成参考 | win_exporter |
| Linux | 参考 | node_exporter | |
| Mysql | 参考 | Mysql_exporter | |
| SQL Server | 参考 | SQL exporter | |
| Redis | 参考 | Redis_exporter | |
| cadvisor | 参考 | cadvisor | |
| rabbitmq | 参考 | 参考 | rabbitmq |
| snmp_exporter | 参考 | 图形展示在测试中 | snmp_exporter |
| Environment | variable | default description |
|---|---|---|
| RABBIT_URL | http://127.0.0.1:15672 | url to rabbitMQ management plugin (must start with http(s)😕/) |
| RABBIT_USER | guest | username for rabbitMQ management plugin. User needs monitoring tag! |
| RABBIT_PASSWORD | guest | password for rabbitMQ management plugin |
| RABBIT_USER_FILE | location of file with username (useful for docker secrets) | |
| RABBIT_PASSWORD_FILE | location of file with password (useful for docker secrets) | |
| PUBLISH_PORT | 9419 | Listening port for the exporter |
| PUBLISH_ADDR | “” | Listening host/IP for the exporter |
| OUTPUT_FORMAT | TTY | Log ouput format. TTY and JSON are suported |
| LOG_LEVEL | info | log level. possible values: “debug”, “info”, “warning”, “error”, “fatal”, or “panic” |
| CAFILE | ca.pem | path to root certificate for access management plugin. Just needed if self signed certificate is used. Will be ignored if the file does not exist |
| CERTFILE | client-cert.pem | path to client certificate used to verify the exporter’s authenticity. Will be ignored if the file does not exist |
| KEYFILE | client-key.pem | path to private key used with certificate to verify the exporter’s authenticity. Will be ignored if the file does not exist |
| SKIPVERIFY | false | true/0 will ignore certificate errors of the management plugin |
| SKIP_VHOST | ^$ | regex, matching vhost names are not exported. First performs INCLUDE_VHOST, then SKIP_VHOST |
| INCLUDE_VHOST | .* | regex vhost filter. Only queues in matching vhosts are exported |
| INCLUDE_QUEUES | .* | regex queue filter. Just matching names are exported |
| SKIP_QUEUES | ^$ | regex, matching queue names are not exported (useful for short-lived rpc queues). First performed INCLUDE, after SKIP |
| RABBIT_CAPABILITIES | bert,no_sort | comma-separated list of extended scraping capabilities supported by the target RabbitMQ server |
| RABBIT_EXPORTERS | exchange,node,queue | List of enabled modules. Possible modules: connections,shovel,federation,exchange,node,queue,memory |
| RABBIT_TIMEOUT | 30 | timeout in seconds for retrieving data from management plugin. |
| MAX_QUEUES | 0 | max number of queues before we drop metrics (disabled if set to 0) |
| EXCLUDE_METRICS |
|
vim /rabbitmq_exporter.sh
#!/bin/sh
# -*- coding: utf-8 -*-
# Date: 2022/11/29echo "download rabbitmq_exporter"
sleep 2
wget -N -P /root/ https://github.com/kbudde/rabbitmq_exporter/releases/download/v1.0.0-RC19/rabbitmq_exporter_1.0.0-RC19_linux_amd64.tar.gzecho "Unzip rabbitmq_exporter"
sleep 2
mkdir -p /usr/local/rabbitmq_exporter
tar -zxf /root/rabbitmq_exporter_1.0.0-RC19_linux_amd64.tar.gz -C /usr/local/rabbitmq_exporterecho "add config.json"
sleep 2
cat >>/usr/local/rabbitmq_exporter/config.json << EOF
{"rabbit_url": "http://127.0.0.1:15672","rabbit_user": "admin","rabbit_pass": "admin@123","publish_port": "9419","publish_addr": "","output_format": "TTY","ca_file": "ca.pem","cert_file": "client-cert.pem","key_file": "client-key.pem","insecure_skip_verify": false,"exlude_metrics": [],"include_queues": ".*","skip_queues": "^$","skip_vhost": "^$","include_vhost": ".*","rabbit_capabilities": "no_sort,bert","enabled_exporters": ["exchange","node","overview","queue"],"timeout": 30,"max_queues": 0
}
EOFecho "rabbitmq_exporter Creating a Service Script"
sleep 2
cat >>/usr/lib/systemd/system/rabbitmq_exporter.service<< EOF
[Unit]
Description=rabbitmq_exporter
Documentation=https://github.com/kbudde/rabbitmq_exporter/releases
After=network.target[Service]
Type=simple
User=root
Group=rootExecStart=/usr/local/rabbitmq_exporter/rabbitmq_exporter \
-config-file=/usr/local/rabbitmq_exporter/config.json
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
Restart=on-failure[Install]
WantedBy=multi-user.target
EOFecho "rabbitmq_exporter Example Set the automatic startup service"
sleep 2
systemctl daemon-reload && systemctl enable --now rabbitmq_exporter
rm -rf /root/rabbitmq_exporter_1.0.0-RC19_linux_amd64.tar.gz
sh /rabbitmq_exporter.sh

- job_name: 'Rabbitmq'scrape_interval: 5sstatic_configs:- targets:- 192.168.11.230:9419labels:instance: RabbitMQ-192.168.11.230
