主机分配 m03 10.0.0.63 zabbix-server
proxy01 10.0.0.65 zabbix-proxy
test 192.168.101.66 zabbix-agent
zabbix-proxy 操作
1.更改主机名字
hostnamectl set-hostname proxy01
2.下载软件包
rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
yum install -y zabbix-proxy-mysql
3.安装数据库
yum install -y mariadb-server
systemctl start mariadb.service
mysqladmin -uroot password 123456
MariaDB [(none)]> create database zabbix_proxy default character set utf8;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all on zabbix_proxy.* to zabbix@'localhost' identified by '123456';
Query OK, 0 rows affected (0.00 sec)
4.编辑配置文件
5.web界面操作
2.配置转发
iptables -F
iptables -t nat -A POSTROUTING -s 192.168.101.0/24 -o eth0 -j MASQUERADE
3.zabbix-agent操作
[root@test ~]# rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/3.0/rhel/7/x86_64/zabbix-agent-3.0.18-1.el7.x86_64.rpm
[root@test ~]# vim /etc/zabbix/zabbix_agentd.conf
Server=192.168.101.65
Hostname=192.168.101.66
[root@test ~]# systemctl restart zabbix-agent.service
4.web界面操作
最后
[root@m03 ~]# zabbix_server -R config_cache_reload
[root@proxy01 ~]# systemctl restart zabbix-proxy.service
[root@test ~]# systemctl restart zabbix-agent.service