方法一、使用官方模板
1、环境
系统:Centos7.9
主机名:
zabbix IP:192.168.1.2 安装zabbix_server
rabbitmq02 IP:192.168.1.14 安装zabbix_agent
RabbitMQ版本:3.3.5(3.8版本也可以) 已开启Web管理插件,可以正常访问rabbitmq(集群、单机无所谓)
[root@rabbitmq02 ~]# rabbitmqctl status | grep rabbit
Status of node rabbit@rabbitmq01 ...
[{rabbitmq_management,"RabbitMQ Management Console","3.3.5"},
{rabbitmq_web_dispatch,"RabbitMQ Web Dispatcher","3.3.5"},
{rabbitmq_management_agent,"RabbitMQ Management Agent","3.3.5"},
{rabbit,"RabbitMQ","3.3.5"},
2、rabbitmq01下载agent
# rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
# yum clean all
yum install zabbix-agent -y
配置zabbix_agent.conf
[root@rabbitmq02 ~]# vim /etc/zabbix/zabbix_agentd.conf
修改部分:Server 换为zabbix-server的地址
Serveractive 换为zabbix-server的地址
hostname
UnsafeUserParameters=1
[root@rabbitmq02 ~]# grep -v '^$' /etc/zabbix/zabbix_agentd.conf |grep -v '#'
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=127.0.0.1,192.168.1.2
ServerActive=127.0.0.1,192.168.1.2
Hostname=rabbitmq02
Include=/etc/zabbix/zabbix_agentd.d/*.conf
UnsafeUserParameters=1
[root@rabbitmq02 ~]# systemctl enable zabbix-agent.service --now
[root@rabbitmq02 ~]# ss -ntulp |grep 10050
tcp LISTEN 0 128 *:10050 *:* users:(("zabbix_agentd",pid=3357,fd=4),("zabbix_agentd",pid=3356,fd=4),("zabbix_agentd",pid=3355,fd=4),("zabbix_agentd",pid=3354,fd=4),("zabbix_agentd",pid=3353,fd=4),("zabbix_agentd",pid=3352,fd=4),("zabbix_agentd",pid=3351,fd=4))
tcp LISTEN 0 128 [::]:10050 [::]:* users:(("zabbix_agentd",pid=3357,fd=5),("zabbix_agentd",pid=3356,fd=5),("zabbix_agentd",pid=3355,fd=5),("zabbix_agentd",pid=3354,fd=5),("zabbix_agentd",pid=3353,fd=5),("zabbix_agentd",pid=3352,fd=5),("zabbix_agentd",pid=3351,fd=5))
3、访问zabbix界面配置主机添加模板
点击最新数据查看