centos7+zabbix3.0完整安装

安装前的准备工作

1、操作系统要求

2、配置编译环境以及安装一些依赖包

3、关闭selinux、firewall

setenforce 0
systemctl stop firewalld.service

4、安装依赖软件包

yum install gcc net-snmp-devel libxml2-devel mysql-devel  -y

搭建lamp

*1.安装mysql

*2.安装apache

*3安装php

下载zabbix3.0

wge thttp://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Development/3.0.0alpha4/zabbix-3.0.0alpha4.tar.gz

tar zxvf  zabbix-3.0.0alpha4.tar.gz

cd zabbix-3.0.0alpha4

./configure  --prefix=/usr/local/zabbix --with-mysql --with-libxml2 --with-net-snmp --with-libcurl  --enable-server --enable-agent
make
make install
//所需参数 ./configuer -h

创建数据库

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
mysql -uroot -p
true
trueMariaDB [(none)]> create database zabbix character set utf8;

MariaDB [(none)]>grant all on zabbix.* to zabbix@localhost identified by '123456';
true
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> show databases;
true+--------------------+
true| Database |
true+--------------------+
true| information_schema |
true| test |
true| zabbix |
true+--------------------+
true3 rows in set (0.00 sec)

导入数据库

1
2
3
4
5
6

[root@localhost zabbix-3.0.0alpha4]# mysql -uzabbix -p123456 zabbix < database/mysql/schema.sql

[root@localhost zabbix-3.0.0alpha4]# mysql -uzabbix -p123456 zabbix < database/mysql/images.sql

[root@localhost zabbix-3.0.0alpha4]# mysql -uzabbix -p123456 zabbix < database/mysql/data.sql

#创建用户组

[root@localhost ~]# groupadd  zabbix
[root@localhost ~]# useradd -g zabbix  zabbix

编辑
[root@localhostlocal#vi/usr/local/zabbix/etc/zabbix_server.conf

DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=123456
BPort=3306

编辑vi /etc/php.ini

post_max_size =16M
max_execution_time =300
max_input_time =300
date.timezone = Asia/Shanghai    

配置web

[root@localhost frontends]# mkdir /var/www/html/zabbix
root@localhost frontends]# cp -a php/* /var/www/html/zabbix/

启动服务

1
2
3
4
5
6
7
[root@localhost frontends]# systemctl restart php-fpm.service
[root@localhost frontends]# systemctl restart php-fpm.service
[root@localhost frontends]# systemctl restart httpd.service
[root@localhost frontends]# /use/local/zabbix/sbin/zabbix_server
ps -ef | grep zabbix
[root@localhost frontends]# netstat -lntp | grep zabbix
tcp 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 38201/zabbix_server

安装zabbix

在IE中输入http://ip/zabbix