Server端配置:

1、更改主机名:hostname server

  关闭内外防火墙

2、从官网下载好rpm包:传到服务器

https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm

3、安装这个rpm包:

rpm -Uvh zabbix-release-5.0-1.el7.noarch.rpm

yum clean all

4、安装Zabbix server 和 agent:

yum -y install zabbix-server-mysql zabbix-agent


5、安装Zabbix frontend

yum install centos-release-scl

6、编辑配置文件 /etc/yum.repos.d/zabbix.repo

    vim /etc/yum.repos.d/zabbix.repo

[zabbix-frontend]

...

enabled=1

...

7、安装 Zabbix frontend packages

yum -y install zabbix-web-mysql-scl zabbix-apache-conf-scl

8、安装Mysql数据库

  yum -y install mariadb mariadb-server

9、启动数据库

   systemctl enable mariadb

 systemctl start mariadb

10、授权zabbix账号

mysql> create database zabbix character set utf8 collate utf8_bin;

mysql> create user zabbix@localhost identified by '123456';

mysql>grant all privileges on zabbix.* to zabbix@localhost identified by '123456';

mysql>flush privileges;

11、初始化zabbix

①、cd /usr/share/doc/zabbix-server-mysql-5.0.21/

②、zcat create.sql.gz | mysql -uroot zabbix

12、为Zabbix server配置数据库

vim /etc/zabbix/zabbix_server.conf

DBPassword=password

13、为Zabbix前端配置PHP(配置时间)

vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf

php_value[date.timezone] = Asia/Shanghai

14、启动Zabbix server和agent进程

    systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm

systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm

15、打开http:IP/zabbix  例:http://10.0.0.147/zabbix

zabbix5.0版本部署_php

①、点击“Next step”检查组件是否OK

zabbix5.0版本部署_vim_02

②、点击“Next step”,配置连接数据库

zabbix5.0版本部署_mysql_03

zabbix5.0版本部署_php_04

zabbix5.0版本部署_mysql_05

zabbix5.0版本部署_php_06

zabbix5.0版本部署_php_07

Username:Admin

Password:zabbix

zabbix5.0版本部署_php_08

16、显示中文乱码解决方法

①、在zabbix-server服务器上安装如下文件符集

yum install wqy-microhei-fonts

②、然后替换linux上默认的字符集

cp /usr/share/fonts/wqy-microhei/wqy-microhei.ttc /usr/share/fonts/dejavu/DejaVuSans.ttf

③、重启zabbix-server,查看乱码是否解决

二、agent端:

1、设置主机名:hostname web1

防火墙systemctl stop firewalld.service

Systemctl disable firewalld.service

2、准备zabbix-repo(下载下来rpm安装)

[root@localhost~]#rpm -ivh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm

3、安装zabbix-agent

[root@localhost ~]# yum -y install zabbix-agent

4、配置主服务器地址

[root@localhost ~]# vim /etc/zabbix/zabbix_agentd.conf

     Server=192.168.100.10,192.168.100.11             被动模式 zabbix-server-ip  

     ServerActive=192.168.100.10,192.168.100.11    主动模式  zabbix-server-ip   (谁从我这里采集数据。)  

     Hostname=web1    

                                     建议使用$HOSTNAME

5、启动zabbix-agent:10050

[root@localhost ~]# systemctl start zabbix-agent

[root@localhost ~]# systemctl enable zabbix-agent

[root@localhost ~]# ss -anlp |grep :10050