Install Zabbix3.2 on CentOS 6.8
1. Install basic software
yum
install
-yvimwgetlrzsz
2. Disable selinux
setenforce0
3. Replace the yum Source
mv
/etc/yum
.repos.d
/CentOS-Base
.repo
/etc/yum
.repos.d
/CentOS-Base
.repo.bak
wgethttp:
//mirrors
.aliyun.com
/repo/epel
.repo-O
/etc/yum
.repos.d
/epel
.repo
wgethttp:
//mirrors
.aliyun.com
/repo/Centos-6
.repo-O
/etc/yum
.repos.d
/CentOS-Base
.repo
4. Install mysql
View installed mysql
yumlistinstalled|
grep
mysql
Delete an installed mysql instance
yumremovemysql*
Install the source of mysql5.6
rpm-ivhhttp:
//dev
.mysql.com
/get/mysql-community-release-el6-5
.noarch.rpm
Install mysql5.6
yum
install
mysql-server-y
Modify the mysql configuration file
[mysqld]
innodb_file_per_table
Start mysql
/etc/init
.d
/mysqld
start
Go to mysql, create a zabbix user, and authorize
mysql-uroot-p
CREATEDATABASEzabbixCHARACTERSETutf8COLLATEutf8_bin;
GRANTALLPRIVILEGESONzabbix.*TOzabbix@localhostIDENTIFIEDBY
'zabbix'
;
5. install apache and php
Configure the web Source
rpm-ivhhttp:
//repo
.webtatic.com
/yum/el6/latest
.rpm
Install apache and php
yum-y
install
httpdphp56wphp56w-gdphp56w-mysqlphp56w-bcmathphp56w-mbstringphp56w-xmlphp56w-ldapntpdatenet-snmp*
Modify the php configuration file
vim
/etc/php
.ini
post_max_size=16M
max_execution_time=300max_input_time=300
date
.timezone=Asia
/Shanghai
always_populate_raw_post_data=-1
Start apache
servicehttpdstart
6. Adjust firewall configurations
iptables-IINPUT-ptcp-mmultiport--destination-port80,10050:10051-jACCEPTserviceiptablessave
Configure NTP time
ntpdate
time
.windows.com
7. Install zabbix to create a user
groupaddzabbix
useradd
-gzabbixzabbix
Create a zabbix folder
mkdir
/usr/local/zabbix
cd
/usr/local/zabbix
Download zabbix3.2
wgethttp:
//jaist
.dl.sourceforge.net
/project/zabbix/ZABBIX
%20Latest%20Stable
/3
.2.0
/zabbix-3
.2.0.
tar
.gz
Extract
tar
zxvfzabbix-3.2.0.
tar
.gz
Go to the zabbix file Database Import table
cd
/usr/local/zabbix/zabbix-3
.2.0
/database/mysql
mysql-uzabbix-pzabbixzabbix<schema.sql
mysql-uzabbix-pzabbixzabbix<images.sql
mysql-uzabbix-pzabbixzabbix<data.sql
Download dependency package
yum
install
-ygccmysql-community-devellibxml2-develunixODBC-develnet-snmp-devellibcurl-devellibssh2-develOpenIPMI-developenssl-developenldap-develfping
Compile and install zabbix
cd
/usr/local/zabbix/zabbix-3
.2.0/
.
/configure
--
enable
-server--
enable
-agent--with-mysql--
enable
-ipv6--with-net-snmp--with-libcurl--with-libxml2--with-unixodbc--with-ssh2--with-openipmi--with-openssl
make
install
Modify zabbix_server configuration file
vim
/usr/local/etc/zabbix_server
.conf
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
FpingLocation=
/usr/sbin/fping
Create a zabbix-web page folder
mkdir
/var/www/html/zabbix
cd
/home/zabbix/downloads/zabbix-3
.2.0
/frontends/php/
cp
-a.
/var/www/html/zabbix/
Create a rule to allow web servers to access front-end files
chcon-Rv--
type
=httpd_sys_content_t
/var/www/html
Run Apache and zabbix to access the Internet
setsebool-Phttpd_can_network_connect=1
setsebool-Pzabbix_can_network=1
Set the owner of the Apache user web interface file
chown
-Rapache:apache
/var/www/html/zabbix
Add permissions to the zabbix web Interface
chmod
+x
/var/www/html/zabbix/conf/
Start script
cp
/usr/local/zabbix/zabbix-3
.2.0
/misc/init
.d
/fedora/core/zabbix_server
/etc/init
.d
/zabbix_server
cp
/usr/local/zabbix/zabbix-3
.2.0
/misc/init
.d
/fedora/core/zabbix_agentd
/etc/init
.d
/zabbix_agentd
chkconfig--add
/etc/init
.d
/zabbix_server
chkconfig--add
/etc/init
.d
/zabbix_agentd
Enable Zabbix server and start Apache and MySQL services
chkconfighttpdon
chkconfigmysqldon
chkconfigzabbix_serveron
chkconfigzabbix_agentdon
Full start
servicezabbix_serverstart
servicezabbix_agentdstart
Solve the Problem of front-end displaying Chinese Characters
cd
/var/www/html/zabbix/fonts/
Add the Chinese font
Msyh. ttf
Modify the php configuration file
vim
/var/www/html/zabbix/include/defines
.inc.php
define(
'ZBX_FONT_NAME'
,
'msyh'
);
define(
'ZBX_GRAPH_FONT_NAME'
,
'msyh'
);
//
font
file
name