Top

zabbix_Server-Install

1.通过Centos安装zabbix-server端

我们的环境是Centos 7.4,服务器:192.168.76.129,客户端:192.168.76.128

1.1 安装依赖环境

[root@server zabbix]# yum install httpd-devel httpd mariadb mariadb-devel mariadb-server php php-devel php-mysql curl curl-devel gcc-c++ -y 
\\这里我用的默认yum源

1.2 下载zabbix安装包并解压

[root@server zabbix]# wget http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/3.2.6/zabbix-3.2.6.tar.gz 
[root@server zabbix]# tar xvf zabbix-3.2.6.tar.gz 

1.3 编译zabbix

[root@server zabbix]# cd zabbix-3.2.6
[root@server zabbix-3.2.6]# ./configure --prefix=/usr/local/zabbix/ --enable-server --with-mysql --with-libcurl
***********************************************************
*            Now run 'make install'                       *
*                                                         *
*            Thank you for using Zabbix!                  *
*                                                         *
***********************************************************
[root@server zabbix-3.2.6]# make -j4 && make -j4 install
\\现在就已经安装上了,完结撒花!:当然要把环境配起来,虽然我想跑路了.

2.配置zabbix-mysql

2.1 创建zabbix数据库并创建用户给予权限

[root@server zabbix-3.2.6]# useradd -s /sbin/nologin zabbix
[root@server zabbix-3.2.6]# mysql
MariaDB [(none)]> create database zabbix charset=utf8;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all on zabbix.* to 'zabbix'@'localhost' identified by '123456';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

2.2 将zabbix需要的数据导入数据库


[root@server zabbix-3.2.6]# cat database/mysql/schema.sql | mysql -uzabbix -p123456 zabbix
[root@server zabbix-3.2.6]# cat database/mysql/images.sql | mysql -uzabbix -p123456 zabbix 
[root@server zabbix-3.2.6]# cat database/mysql/data.sql | mysql -uzabbix -p123456 zabbix
\\这里要按顺序导入

2.3 修改配置文件选项

[root@server zabbix-3.2.6]# echo "DBPassword=123456" >> /usr/local/zabbix/etc/zabbix_server.conf

3.拷贝启动脚本

[root@server zabbix-3.2.6]# cd misc/init.d/tru64/
[root@server tru64]# cp * /etc/init.d/
[root@server tru64]# ln -s /usr/local/zabbix/sbin/zabbix_server /usr/local/sbin/
[root@server tru64]# chmod +x /etc/init.d/zabbix_*
[root@server tru64]# cd -

4.拷贝php文件

[root@server zabbix-3.2.6]# cd frontends/php/
[root@server php]# cp -a * /var/www/html/

5.启动apache并进行zabbix网页初始化安装

5.1 安装相关依赖

[root@server php]# yum install php-gd gd php-mbstring php-bcmath php-xml -y

5.2 修改php.ini配置

[root@server php]# sed -i '/post_max_size/s/8/16/g;/max_execution_time/s/30/300/g;/max_input_time/s/60/300/g;s/\;date.timezone.*/date.timezone \= PRC/g;s/\;always_populate_raw_post_data/always_populate_raw_post_data/g' /etc/php.ini

5.3 修改目录权限并重启http服务

[root@server php]# chmod o+w /var/www/html/conf/
[root@server php]# systemctl start httpd

5.4 打开网页进行安装




\\进去后下方会提示Zabbix server is not running:执行/etc/init.d/zabbix_server start

6.成功界面

\\客户端等下回在写,嘻嘻偷懒一下。