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. 【luogu P3952 时间复杂度】 题解

    对于2017 D1 T2 这道题 实实在在是个码力题,非常考验耐心. 其实大体的思路并不是非常难想出来,但是要注意的小细节比较多. 题目链接:https://www.luogu.org/problem ...

  2. [转]Matlab2012b安装详解

    matlab2012b安装文件下载: http://yunpan.cn/cVY5VsSeUXzai (提取码:ec84) 1.双击setup.exe进行安装.安装中选择“不使用Internet安装” ...

  3. 纯JS拖动案例

    <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...

  4. CSS&JS定位器

    一.CssSelector定位器 1.概述 CssSelector是效率很高的元素定位方法,Selenium官网的Document里极力推荐使用CSS locator,而不是XPath来定位元素,原因 ...

  5. IO Jar包

    密码e7ed https://pan.baidu.com/share/init?surl=LakzlwrjolWwpoft5j6aBg

  6. Oracle oerr工具介绍

    (1)什么是oerr oerr是Oracle提供的在UNIX/Linux上查看Oracle错误的小工具,使用起来非常方便. (2)如何使用 oerr工具位于ORACLE_HOME下面,可以使用whic ...

  7. 使用终端命令行将本地项目上传到Github并提交代码

    第一步: 在Github上创建自己的repository 第二步:建立本地仓库cd到你的本地项目根目录下,执行git命令 1:$ cd 到你的项目目录下 2:$ git init 第三步:将本地项目工 ...

  8. 构建高可靠hadoop集群之3- Quorum Journal Manager

    在正式环境中,搭建高可靠(ha)的系统是必须的. 例如oralce的rac,apache集群,windows服务器集群 本文不再赘言ha的重要性. 本文主要是对 http://hadoop.apach ...

  9. 在Liunx Mint下无法切换到root用户

    提示 su: Authentication failure 以ubuntu的mint root用户默认是也是禁止的 需要手动打开才行 a)root启用 执行下面的操作:1.先解除root锁定,为roo ...

  10. 【PHP项目】产品新增的多图上传

    产品新增:多图上传 1:html的更改 在 type=file的input框中添加multiple="multiple" name属性中必须添加[] ,否则$_FILES只能接收最 ...