RabbitMQ的配置参考 https://github.com/jasonmcintosh/rabbitmq-zabbix

简而言之,具体分为几个步骤:

1. 将脚本文件(scripts文件夹)和配置文件(zabbix_agent.d/zabbix-rabbitmq.conf)拷贝至/etc/zabbix/ 文件夹,按需修改文件夹权限给zabbix用户(自测环境是使用root用户,所以不需要修改权限)

2. 配置。不建议使用guest用户,而是新建用户,并赋予其“只读权限”,即仅有几项监控相关的API可以访问,以下仅是一个参考:

rabbitmqctl add_user zabbix pass
rabbitmqctl set_user_tags zabbix monitoring
rabbitmqctl set_permissions -p / zabbix '^aliveness-test$' '^amq\.default$' '^aliveness-test$’

编辑/etc/zabbix/scripts/rabbitmq/.rab.auth文件,填写如下内容:

USERNAME=guest
PASSWORD=******
CONF=/etc/zabbix/zabbix_agent.conf
LOGLEVEL=DEBUG
LOGFILE=/var/log/zabbix/rabbitmq_zabbix.log
HOSTNAME=192.168.122.208
PORT=

3. 在Zabbix Dashboard上导入模板,配置给相关主机

4. 重启zabbix-agent
注意,因为我们是直接root用户,所以暂时可不需要创建zabbix用户,只需要确保.rab.auth文件中的配置是正确的即可。当然,最最最重要的是要确保rabbitmq-plugins中启用了rabbitmq-management: 
[root@f-q ~(keystone_admin)]# rabbitmq-plugins enable rabbitmq_management
The following plugins have been enabled:
mochiweb
webmachine
rabbitmq_web_dispatch
amqp_client
rabbitmq_management_agent
rabbitmq_management
Applying plugin configuration to rabbit@f-q... started plugins.
检查rabbitmq-plugins插件列表可发现:
这个问题的排查来自于最开始配置了模板之后,提示Dead RabbitMQ,但是RabbitMQ服务正常。于是简单的尝试http api,看下效果:
[root@f-q ~(keystone_admin)]#  curl -i -u guest:***** http://192.168.122.208:15672/api/vhosts
curl: () Failed connect to 192.168.122.208:; Connection refused
[root@f-q ~(keystone_admin)]# curl -i -u guest:***** http://192.168.122.208:5672/api/vhosts
AMQP
[root@f-q ~(keystone_admin)]# curl curl -i -u guest:***** http://192.168.122.208:25672/api/
curl: () Could not resolve host: curl; Name or service not known
curl: () Empty reply from server
[root@f-q ~(keystone_admin)]#
其实这里由于对rabbitmq的了解不够,所以没有第一时间看到问题——即模板配置说明中明确默认使用的是15672的端口,而我们的15672的端口并不连通,说明这个端口背后的服务是没启动的,那么这个端口是干嘛的呢?通过Google,我们查到RabbitMQ的官方文档中的说明:
: epmd, a peer discovery service used by RabbitMQ nodes and CLI tools
, : used by AMQP -- and 1.0 clients without and with TLS
: used for inter-node and CLI tools communication (Erlang distribution server port) and is allocated from a dynamic range (limited to a single port by default, computed as AMQP port + ). Unless external connections on these ports are really necessary (e.g. the cluster uses federation or CLI tools are used on machines outside the subnet), these ports should not be publicly exposed. See networking guide for details.
-: used by CLI tools (Erlang distribution client ports) for communication with nodes and is allocated from a dynamic range (computed as server distribution port + through server distribution port + ). See networking guide for details.
: HTTP API clients, management UI and rabbitmqadmin (only if the management pluginis enabled)
, : STOMP clients without and with TLS (only if the STOMP plugin is enabled)
, : (MQTT clients without and with TLS, if the MQTT plugin is enabled
: STOMP-over-WebSockets clients (only if the Web STOMP plugin is enabled)
: MQTT-over-WebSockets clients (only if the Web MQTT plugin is enabled)
也就是说,我们必须要启用rabbitmq_management插件,才能保证15672,HTTP API客户端可用!
那么完成脚本和参数配置,并导入模板后,试着创建主机(虽然是fake driver),看到zabbix dashboard上的变化:
有数据变化就是好的……虽然只有message count和message rates,没有我们想要的连接数等信息……

为Zabbix配置RabbitMQ监控模板的更多相关文章

  1. 自学Zabbix11.1 Zabbix 配置SNMP监控

    点击返回:自学Zabbix之路 点击返回:自学Zabbix4.0之路 点击返回:自学zabbix集锦 自学Zabbix11.1 Zabbix 配置SNMP监控 1. 概述 zabbix采集数据方式: ...

  2. zabbix配置自定义监控

    目录 zabbix配置自定义监控项---进程监控 1. 编写获取进程状态的脚本 2. 修改配置文件,添加自定义key 3. 配置监控项 4. 添加触发器 5. 媒介和动作 6. 触发并验证 zabbi ...

  3. 给zabbix添加percona监控模板

    简单说明一下给zabbix添加的percona的监控模板. 在percona官方网站有说明怎么安装,这里记录下步骤.首先搭建好的zabbix环境. 监控插件连接 : 链接:https://pan.ba ...

  4. zabbix 配置SNMP监控

    什么是SNMP? 简单网络管理协议(SNMP),由一组网络管理的标准组成,包含一个应用层协议(application layer protocol).数据库模型(database schema)和一组 ...

  5. zabbix 自定义 nginx 监控模板

    打开zabbix首页→配置→模板→创建模板模板名称:Template App NGINXagent 需添加自定义监控项:UserParameter=nginx.status[*],/bin/bash ...

  6. Zabbix配置邮件监控

    zabbix服务端配置 安装软件并配置 使用第三方邮件实现报警 1. 安装软件 $ yum -y install mailx 2. 配置发送邮件账号密码和服务器 $ vim /etc/mail.rc ...

  7. zabbix配置主动式监控的步骤(原创)

    步骤如下: 1.克隆模板.命名新的模板名,并点击"监控项",全选,批量更新时第一个“类型”打勾,客户端改为主动式: 2.添加客户端或更改原有的模板为新模板(服务器端添加客户端时的配 ...

  8. zabbix实现自定义监控

    实现自定义监控项实例 .创建主机组 .创建主机 .创建监控项 .到需要监控的主机的agent中添加自定义的监控项目 cd /etc/zabbix/zabbix_agentd.d vi userpara ...

  9. (5)zabbix配置详解

    zabbix配置介绍 zabbix配置内容比较多,我们要分为9大块来讲解.分别如下:1.主机与组不用多数,顾名思义,他是添加主机配置与组配置. 2.监控项需要监控的项目,例如服务器负载可以使一个监控项 ...

随机推荐

  1. HDU 1372 Knight Moves(最简单也是最经典的bfs)

    传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1372 Knight Moves Time Limit: 2000/1000 MS (Java/Othe ...

  2. phpstorm的主题相关

    下载地址: http://phpstorm-themes.com/ 安装方法 JAR文件 导航->file->Import Settings->然后选择你刚才下载的JAR文件-> ...

  3. c语言描述的快速排序法

    #include<stdio.h> #include<stdlib.h> void QuikSort(int a[],int m,int n){ //第一个数作为关键字,比他大 ...

  4. Kong Api 初体验

    请查看原文: https://www.fangzhipeng.com/nginx/kong/2016/07/11/kong-api-gateway/ Kong是一个可扩展的开源API层(也称为API网 ...

  5. oracle删除一个表内的重复数据,

    查询以及删除一个数据库表内的重复数据. 1.查询表中的多余的重复记录,重复记录是根据单个字段来判断的. select * from biao where id in (select id from b ...

  6. Swift_控制流

    Swift_控制流 点击查看源码 for-in 循环 //for-in 循环 fileprivate func testForIn() { //直接循环提取内部数据 //[1,5] for index ...

  7. 判断js中数据类型 的最短代码

    判断字符串类型的: function isString(obj) { return obj+"" === obj; } 判断bool类型的: function isBool(obj ...

  8. 【网络流】EK算法及其优化

    今天上午我仿佛知道了什么叫做网络流,这里推荐一篇博客,大家入门网络流的可以看一下这篇博客,保证一看就懂! 博客链接: 网络流入门 这里有一篇经过我改过的EK带注释代码(博客里也有一样的,只是加了一些注 ...

  9. Sonarqube中文插件-Linux[20180105]

    前言     上次安装了Sonarqube英文版使用起来不方便,这次为Sonarqube安装中文插件. 前期准备:     软件下载: https://github.com/SonarQubeComm ...

  10. CentOS 7.4使用yum源安装php7.2

    1.如果之前已经安装我们先卸载一下 yum -y remove php* 2.由于linux的yum源不存在php7.x,所以我们要更改yum源 rpm -Uvh https://dl.fedorap ...