更改主机名:hostnamectl set-hostname zabbix_server
wget http://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-agent-5.0.42-1.el7.x86_64.rpm
rpm -Uvh zabbix-agent-5.0.42-1.el7.x86_64.rpm
安装Zabbix server 和 agent:
yum -y install zabbix-server-mysql zabbix-agent
安装Zabbix frontend
yum -y install centos-release-scl
编辑配置yum文件 /etc/yum.repos.d/zabbix.repo
[zabbix-frontend]
...
enabled=1
...
安装 Zabbix frontend packages
yum -y install zabbix-web-mysql-scl zabbix-apache-conf-scl
安装Mysql数据库,也可以使用已有的数据库
yum -y install mariadb mariadb-server
启动数据库
systemctl enable mariadb
systemctl start mariadb
授权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>grant all privileges on zabbix.* to zabbix@'%' identified by '123456';
mysql>flush privileges;
11、初始化zabbix
①、cd /usr/share/doc/zabbix-server-mysql-5.0.29/ //根据自己安装的版本进入特定的目录,也许你不是zabbix-server-mysql-5.0.29
②、zcat create.sql.gz | mysql -uroot zabbix
12、为Zabbix server配置数据库
vim /etc/zabbix/zabbix_server.conf
DBPassword=123456
DBHost=127.0.0.1
DBName=zabbix
DBUser=zabbix
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://172.18.1.200/zabbix
zabbix的默认账密:
Username:Admin
Password:zabbix
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,查看乱码是否解决
标签:zabbix5.0,Zabbix,agent,server,Centos7.9,zabbix,yum,mysql,安装 From: https://www.cnblogs.com/liuchongliang/p/18128415