一、客户机配置
1、下载地址
http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/
http://repo.zabbix.com/zabbix/
2、安装agentrpm -ivh zabbix-agent-3.4.7-1.el7.x86_64.rpm
3、修改agent配至文件
vim /etc/zabbix/zabbix_agentd.conf
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=192.168.1.139
ListenPort=10050
ServerActive=192.168.1.139
Hostname=192.168.1.120
Include=/etc/zabbix/zabbix_agentd.d/
4、开启agent 服务 开启开机自启
systemctl start zabbix-agent.service
systemctl enable zabbix-agent.service
二、server端配置
检验:
ss -tnl | grep 100
systemctl status zabbix-agent
rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/6/i386/zabbix-release-2.4-1.el6.noarch.rpm
安装zabbix-agent。
yum install -y zabbix-agent
配置zabbix-agent
vim /etc/zabbix/zabbix_agentd.conf
修改下面选项,请将ip地址换成您自己的zabbix server地址,Hostname换成自己的本机IP
Server=zabbix server ip
ServerActive=zabbix server ip
Hostname=本机IP
查看修改内容
cat zabbix_agentd.conf |grep -v "^#"
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=192.168.1.139
ListenPort=10050
ServerActive=192.168.1.139
Hostname=192.168.1.120
Include=/etc/zabbix/zabbix_agentd.d/
将zabbix-agent启动并加入开机启动。
systemctl start zabbix-agent ###启动agent
systemctl enable zabbix-agent ###开机启动agent
Server=192.168.1.164
ServerActive=192.168.1.164
ListenPort=10050
Hostname=192.168.1.152(服务器hostname)
firewall-cmd --permanent --add-port=10050/tcp
firewall-cmd --permanent --add-port=10051/tcp
关闭防火墙及selinux
systemctl stop firewalld.service
systemctl disable firewalld.service
查看防火墙状态
systemctl status firewalld
查看开机是否启动防火墙服务
systemctl is-enabled firewalld
Include=/etc/zabbix/zabbix_agentd.d/
注释:
zabbix-agent 服务起不开,使用start 命令出报错
解决方法:
修改/etc/selinux/config 文件
将SELINUX=enforcing改为SELINUX=disabled
重启机器
vi /etc/selinux/config
查阅相关资料
https://blog.csdn.net/aiming66/article/details/60467241
要关闭selinux服务 然后重启服务器验证
转载于:https://blog.51cto.com/11485155/2379447