CentOS 7.5上部署Zabbix 3.4

Posted 心海轩语

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CentOS 7.5上部署Zabbix 3.4相关的知识,希望对你有一定的参考价值。

1.安装数据库,并将数据库设置为开机自启动,执行安全初始化

  # yum install -y mariadb mariadb-server
  # systemctl enable mariadb
  # systemctl restart mariadb
  # mysql_secure_installation

2.添加Zabbix源
  # rpm -i http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm

3.安装Zabbix服务器,前端,代理
  # yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent httpd

4.创建一个名为zabbix的数据库,并将其所有权限授权给zabbix用户
  # mysql -uroot -p
  MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
  MariaDB [(none)]> grant all privileges on zabbix.* to [email protected]‘localhost‘ identified by ‘password‘;
  MariaDB [(none)]> grant all privileges on zabbix.* to [email protected]‘127.0.0.1‘ identified by ‘password‘;
  MariaDB [(none)]> flush privileges;
  MariaDB [(none)]> quit

5.导入数据
  # zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix

6.为Zabbix服务器配置数据库,编辑/etc/zabbix/zabbix_server.conf文件
  DBPassword=password

7.为Zabbix前端配置php,编辑/etc/httpd/conf.d/zabbix.conf文件,修改对应的时区
  php_value date.timezone Asia/Shanghai

8.配置防火墙
  # firewall-cmd --permanent --zone=public --add-port=10051/tcp
  # firewall-cmd --permanent --zone-public --add-service=http
  # firewall-cmd --reload

9.配置selinux
  # setsebool -P httpd_can_connect_zabbix on
  # setsebool -P httpd_can_network_connect_db on
  # setsebool -P httpd_can_network_connect on
  # setsebool -P zabbix_can_network on
  # ausearch -c ‘zabbix_server‘ --raw | audit2allow -M my-zabbixserver
  # semodule -i my-zabbixserver.pp
  # semanage fcontext -a -t httpd_sys_content_t "/usr/share/zabbix(/.*)?"
  # restorecon -RFvv /usr/share/zabbix

10.启动Zabbix
  # systemctl enable zabbix-server
  # systemctl enable zabbix-agent
  # systemctl restart zabbix-server
  # systemctl restart zabbix-agent

11.配置完成,启动Zabbix web管理界面,根据配置向导完成最后的安装配置

以上是关于CentOS 7.5上部署Zabbix 3.4的主要内容,如果未能解决你的问题,请参考以下文章

CentOS 7.5 部署安装 Zabbix

Zabbix +Grafana

CentOS 7下安装部署Zabbix3.4

centos 7.3 安装zabbix 3.4 开源监控系统

Centos7 下安装部署zabbix-agent客户端

Centos7 下安装部署zabbix-agent客户端