6.6安装编译安装zabbix3.2

添加yum源

get -O /etc/yum.repos.d/CentOS-Base.repo    http://mirrors.aliyun.com/repo/Centos-6.repo #安装阿里云yum源
wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-6.repo 

一、安装MySQL

安装MySQL
rpm -ivh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
yum -y install mysql-server mysql-devel
修改MySQL的配置文件,添加以下几行
vim /etc/my.cnf
default-storage-engine = innodb
innodb_file_per_table
collation-server = utf8_general_ci
init-connect = 'SET NAMES utf8'
character-set-server = utf8
设置MySQL自动启动并启动MySQL
chkconfig mysqld on
service mysqld start
/usr/bin/mysqladmin -u root password '123456'
创建Zabbix数据库
mysql -uroot -p123456
mysql> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.04 sec)
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by '123456';
Query OK, 0 rows affected (0.01 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye

 

二、安装PHP

安装PHP

rpm -ivh http://repo.webtatic.com/yum/el6/latest.rpm
yum -y install httpd php56w php56w-gd php56w-mysql php56w-bcmath php56w-mbstring php56w-xml php56w-ldap wget ntpdate net-snmp*   gcc mysql-community-devel libxml2-devel  unixODBC-devel net-snmp-devel libcurl-devel libssh2-devel OpenIPMI-devel openssl-devel openldap-devel fping libevent-devel pcre-devel
修改PHP配置文件
vim /etc/php.ini
post_max_size=16M
max_execution_time=300
max_input_time=300
date.timezone=Asia/Shanghai
always_populate_raw_post_data=-1
设置HTTP自动启动并启动HTTP(也可以使用nginx)
chkconfig httpd on
service httpd start 点击

 

三、下载zabbix3.2.0安装包

wget https://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.2.7/zabbix-3.2.7.tar.gz
tar -xvf zabbix-3.2.7.tar.gz  -C /usr/share
cd  /usr/share/zabbix-3.2.7/database/mysql/
mysql -uzabbix -p123456  zabbix < schema.sql
mysql -uzabbix -p123456  zabbix < images.sql 
mysql -uzabbix -p123456  zabbix < data.sql
cd ../../
yum install java* -y #如果不监控Java可以不安装,去掉 --enable-java选项即可
./configure --prefix=/usr/local/zabbix3.2 --enable-server --with-mysql --with-net-snmp --with-libcurl --with-libxml2 --enable-agent --enable-ipv6 --enable-agent --enable-java --with-unixodbc --with-ldap --with-libcurl --with-ssh2 
make install
ln -sv /usr/local/zabbix3.2  /usr/local/zabbix
修改配置启动文件
vim /usr/local/zabbix3.2/etc/zabbix_server.conf
DBHost=10.1.1.249
DBName=zabbix
DBUser=zabbix
DBPassword=123456
创建zabbix-web页面文件夹
groupadd -r zabbix
useradd -g zabbix  -r -s /sbin/nologin -M zabbix
mkdir /var/www/html/zabbix
cd  /usr/share/zabbix-3.2.7/frontends/php/
cp -a . /var/www/html/zabbix/
设置Apache用户web接口文件的所有者
chown -R apache:apache /var/www/html/zabbix
chmod +x /var/www/html/zabbix/conf/
cp /usr/share/zabbix-3.2.7/misc/init.d/fedora/core/zabbix_server /etc/init.d/zabbix-server
cp /usr/share/zabbix-3.2.7/misc/init.d/fedora/core/zabbix_agentd /etc/init.d/zabbix-agentd
 vim /etc/init.d/zabbix-server
 BASEDIR=/usr/local/zabbix-server  #修改为安装目录
vim /etc/init.d/zabbix-agentd
 BASEDIR=/usr/local/zabbix-server  #修改为安装目录

启动服务

/etc/init.d/zabbix-server start
访问URL:  http://10.1.1.249/zabbix/,按提示操作
默认登录账户密码:Admin zabbix

posted @ 2017-11-12 11:34  百衲本  阅读(535)  评论(0编辑  收藏  举报
cnblogs_post_body { color: black; font: 0.875em/1.5em "微软雅黑" , "PTSans" , "Arial" ,sans-serif; font-size: 15px; } cnblogs_post_body h1 { text-align:center; background: #333366; border-radius: 6px 6px 6px 6px; box-shadow: 0 0 0 1px #5F5A4B, 1px 1px 6px 1px rgba(10, 10, 0, 0.5); color: #FFFFFF; font-family: "微软雅黑" , "宋体" , "黑体" ,Arial; font-size: 23px; font-weight: bold; height: 25px; line-height: 25px; margin: 18px 0 !important; padding: 8px 0 5px 5px; text-shadow: 2px 2px 3px #222222; } cnblogs_post_body h2 { text-align:center; background: #006699; border-radius: 6px 6px 6px 6px; box-shadow: 0 0 0 1px #5F5A4B, 1px 1px 6px 1px rgba(10, 10, 0, 0.5); color: #FFFFFF; font-family: "微软雅黑" , "宋体" , "黑体" ,Arial; font-size: 20px; font-weight: bold; height: 25px; line-height: 25px; margin: 18px 0 !important; padding: 8px 0 5px 5px; text-shadow: 2px 2px 3px #222222; } cnblogs_post_body h3 { background: #2B6695; border-radius: 6px 6px 6px 6px; box-shadow: 0 0 0 1px #5F5A4B, 1px 1px 6px 1px rgba(10, 10, 0, 0.5); color: #FFFFFF; font-family: "微软雅黑" , "宋体" , "黑体" ,Arial; font-size: 18px; font-weight: bold; height: 25px; line-height: 25px; margin: 18px 0 !important; padding: 8px 0 5px 5px; text-shadow: 2px 2px 3px #222222; } 回到顶部 博客侧边栏 回到顶部 页首代码 回到顶部 页脚代码