CentOS 6.8安装Zabbix3.2

前端之家收集整理的这篇文章主要介绍了CentOS 6.8安装Zabbix3.2前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1.安装基础软件

yuminstall-yvimwgetlrzsz

2.关闭selinux

setenforce0

3.更换yum源

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.安装MysqL

查看已安装的MysqL

yumlistinstalled|grepMysqL

删除已安装的MysqL

yumremoveMysqL*

安装MysqL5.6的源

rpm-ivhhttp://dev.MysqL.com/get/MysqL-community-release-el6-5.noarch.rpm

安装MysqL5.6

yuminstallMysqL-server-y

修改MysqL配置文件

[MysqLd]
innodb_file_per_table

启动MysqL

/etc/init.d/MysqLdstart

进入MysqL,创建zabbix用户并授权

MysqL-uroot-p
CREATEDATABASEzabbixCHARACTERSETutf8COLLATEutf8_bin;
GRANTALLPRIVILEGESONzabbix.*TOzabbix@localhostIDENTIFIEDBY'zabbix';

5.安装apache、PHP

配置web源

rpm-ivhhttp://repo.webtatic.com/yum/el6/latest.rpm

安装apache、PHP

yum-yinstallhttpdPHP56wPHP56w-gdPHP56w-MysqLPHP56w-bcmathPHP56w-mbstringPHP56w-xmlPHP56w-ldapntpdatenet-snmp*

修改PHP配置文件

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

启动apache

servicehttpdstart

6.调整防火墙配置

iptables-IINPUT-ptcp-mmultiport--destination-port80,10050:10051-jACCEPTserviceiptablessave

配置NTP时间

ntpdatetime.windows.com

7.安装zabbix 创建用户

groupaddzabbix
useradd-gzabbixzabbix

创建zabbix文件

mkdir/usr/local/zabbix
cd/usr/local/zabbix

下载zabbix3.2

wgethttp://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.2.0/zabbix-3.2.0.tar.gz

解压

tarzxvfzabbix-3.2.0.tar.gz

进入zabbix文件数据库导入表

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

下载依赖包

yuminstall-ygccMysqL-community-devellibxml2-develunixODBC-develnet-snmp-devellibcurl-devellibssh2-develOpenIPMI-developenssl-developenldap-develfping

编译安装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-opensslmakeinstall

修改zabbix_server配置文件

vim/usr/local/etc/zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
FpingLocation=/usr/sbin/fping

创建zabbix-web页面文件

mkdir/var/www/html/zabbix
cd/home/zabbix/downloads/zabbix-3.2.0/frontends/PHP/
cp-a./var/www/html/zabbix/

创建一个规则允许web服务器访问前端文件

chcon-Rv--type=httpd_sys_content_t/var/www/html

运行Apache和zabbix访问外网

setsebool-Phttpd_can_network_connect=1
setsebool-Pzabbix_can_network=1

设置Apache用户web接口文件的所有者

chown-Rapache:apache/var/www/html/zabbix

为zabbix web界面添加权限

chmod+x/var/www/html/zabbix/conf/

启动脚本

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

启用Zabbix服务器,Apache和MysqL服务启动

chkconfighttpdon
chkconfigMysqLdon
chkconfigzabbix_serveron
chkconfigzabbix_agentdon

全面启动

servicezabbix_serverstart
servicezabbix_agentdstart

解决前端显示中文问题

cd/var/www/html/zabbix/fonts/

中文字体放入

msyh.ttf

修改PHP配置文件

vim/var/www/html/zabbix/include/defines.inc.PHP
define('ZBX_FONT_NAME','msyh');
define('ZBX_GRAPH_FONT_NAME','msyh');//fontfilename

猜你在找的CentOS相关文章