系统相关
首页 > 系统相关> > yum安装zabbix5.0

yum安装zabbix5.0

作者:互联网

目录

1.搭建基础环境lamp

关闭防火墙与selinux
systemctl stop firewalld
setenforce 0

安装apache并启动
yum install httpd -y
systemctl enable --now httpd

安装数据库并启动
yum install mariadb-server mariadb -y
systemctl enable --now mariadb

安装php
yum install php php-mysql php-gd php-pear -y
测试php
vim/var/www/html/testphp.php
编辑内容如下
<?php 

phpinfo();

?>
重启apache
systemctl restart httpd
浏览器访问 http://server-ip-address/testphp.php. 将会显示php的版本信息.

2.安装zabbix

2.1下载zabbix官方源

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 makecache

2.2安装Zabbix服务器和代理

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

2.3安装启用红帽软件插件

yum -y install centos-release-sc

2.4编辑文件/etc/yum.repos.d/zabbix.repo并启用zabbix-frontend存储库

[zabbix-frontend]
...
enabled=1
...

2.5安装Zabbix前端软件包

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

2.6创建初始数据库

mysql -uroot
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> create user zabbix@localhost identified by '123456';         //密码自定义
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> quit
Bye

2.7在Zabbix服务器主机上,导入初始架构和数据

zcat /usr/share/doc/zabbix-server-mysql-5.0.12/create.sql.gz |mysql -uzabbix -p'123456' zabbix

2.8编辑文件/etc/zabbix/zabbix_server.conf

DBHost=localhost    //取消这行注释
DBName=zabbix
DBUser=zabbix
DBPassword=123456   //取消注释并把密码改为之前设置的密码

2.9编辑文件/etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf,取消注释并为您设置正确的时区

php_value[date.timezone] = Asia/Shanghai

2.10启动Zabbix服务器和代理进程

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

3.配置Zabbix前端

连接到新安装的Zabbix前端:http:// server_ip_or_name /zabbix








设置中文界面



标签:zabbix5.0,Zabbix,server,zabbix,yum,php,安装
来源: https://www.cnblogs.com/liping0826/p/14817477.html