1. 程式人生 > >CentOS 7.4安裝Zabbix 3.4.2

CentOS 7.4安裝Zabbix 3.4.2

QQ交流群:64655993

安裝環境

[[email protected] ~]# cat /etc/redhat-release

CentOS Linux release 7.4.1708 (Core)

關閉防火牆

Centos 7.3開始iptables就不存在了改成firewalld了,關閉掉方便點

[[email protected] ~]# systemctl stop firewalld.service

[[email protected] ~]# systemctl disable firewalld.service

Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.

Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

關閉SElinux

SElinux是美國國家安全域性開發的安全子系統,很麻煩,關閉了。

[[email protected] ~]# vim /etc/selinux/config

把SELNUX=enforcing換成SELINUX=disabled

,我們修改了SEliunx的配置檔案,是重啟後的狀態,但是不影響現在的狀態,所以要關閉當前啟用的SElinux

[[email protected] ~]# setenforce 0

現在SElinux關閉了

資料庫安裝與配置

安裝MariaDB資料庫

[[email protected] ~]# yum install mariadb-server mariadb –y

mariadb資料庫相關命令
 

systemctl start mariadb #啟動MariaDB

systemctl stop mariadb #停止MariaDB

systemctl restart mariadb #重啟MariaDB

systemctl enable mariadb #設定開機啟動

安裝及配置Zabbix3.4

安裝原始碼庫配置部署包 

[[email protected] ~]# rpm -ivhhttp://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm

安裝Zabbix部署包

使用Mysql資料庫安裝Zabbix server、WEB前端和代理

[[email protected] ~]# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent

建立資料庫

[[email protected] /]# systemctl start mariadb

[[email protected] /]# systemctl enable mariadb

Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.

[[email protected] /]# mysql -uroot -p

Enter password: #空密碼

MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;

MariaDB [(none)]> grant all privileges on zabbix.* to [email protected] identified by ‘zabbix‘;

MariaDB [(none)]> flush privileges;

MariaDB [(none)]> quit

匯入初始架構和資料。系統將提示您輸入新建立的密碼。 

[[email protected] /]# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix

配置Zabbix伺服器的資料庫

[[email protected] /]# DBPassword=zabbix

然後編輯下面的檔案

[[email protected] ~]# vim /etc/zabbix/zabbix_server.conf

在126行加入DBPassword=zabbix

啟動Zabbix Server程序 

[[email protected] /]# systemctl restart zabbix-server zabbix-agent httpd

[[email protected] /]# systemctl enable zabbix-server zabbix-agent httpd

編輯Zabbix前端PHP配置,更改時區 

[[email protected] /]# vim /etc/httpd/conf.d/zabbix.conf

修改完成後需要重啟Apache Web伺服器

[[email protected] /]# systemctl restart httpd

[[email protected] /]# systemctl enable httpd

安裝Zabbix Web

http://ip/zabbix/

完成後會生成配置檔案

[[email protected]rv /]# more /etc/zabbix/web/zabbix.conf.php

安裝完成,預設使用者名稱Admin密碼zabbix

安裝完成

 

 

轉發自:http://www.azurew.com/7930.html