Centos 7.x 搭建 Zabbix3.4

前提要安装了LAMP(官方推荐环境) LNMP也可以

一、安装、配置Zabbix3.4

  1:安装zabbix_RPM包

rpm -i https://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm 

  2:安装zabbix服务器、客户端

yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent 

  3:创建zabbix数据库以及数据库用户名

# mysql -uroot -p
 password
 mysql> create database zabbix character set utf8 collate utf8_bin;
 mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'password';
 mysql> quit; 

  4:导入zabbix数据库文件到新建好的zabbix数据库

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

  5:修改 zabbix_server.conf配置文件

Edit file /etc/zabbix/zabbix_server.conf
DBPassword=password

  6:修改 zabbix.conf时区,去掉php_value前面的注释,并修改后面的时区

Edit file /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai 

  7:重新启动zabbix_server、zabbix_agent、Httpd并设置成开机启动

systemctl restart zabbix-server zabbix-agent httpd
systemctl enable zabbix-server zabbix-agent httpd 

  8:访问地址 http://Server_ip or Server_name/zabbix

常见问题:

  1:关闭Selinux、Firewalld;

  2:如出现数据库连接失败,请修改主机地址:localhost --> 127.0.01 , 如果出现zabbix_server链接状态为失败的话,查看mysql错误日志文档:/var/log/zabbx/zabbix_server.log。

原文地址:https://www.cnblogs.com/willamwang/p/9627617.html