First, the production environment:
Os:centos Release 6.8 (Final)
Web Server Software: apache/2.2.15 (Unix)
PHP Operating Environment: PHP 5.4.45 (CLI) (Built:aug 14:41:13)
Database system: MySQL Ver 14.14 distrib 5.5.49, for Linux (x86_64) using ReadLine 5.1
Web Environment: lamp=linux+apache+mysql+php
Second, Zabbix software package Download:
Download page:http://www.zabbix.com/download.php
[Email protected] html]# wget
Http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.2.0/zabbix-3.2.0.tar.gz
Third, installation article
1 . creating, importing, and Zabbix databases
[Email protected] html]# cd/var/www/html
[Email protected] html]# tar zxvf zabbix-3.2.0.tar.gz
[email protected]]cd/var/www/html/zabbix-3.2.0/database/mysql # go to MySQL database create script directory
[Email protected]/]# mysql-uroot-p
Enter Password:
Mysql> CREATE database Zabbix character set UTF8; #创建数据库zabbix, and the database encoding uses UTF8
Mysql>insert into Mysql.user (Host,user,password) VALUES (' localhost ', ' Zabbix ', Password (' * * * * ')); #新建账户和密码
mysql> flush Privileges; #刷新系统授权表
Mysql>grant all on zabbix.* to ' Zabbix ' @ ' 127.0.0.1 ' identified by ' * * * * * * * with GRANT option; #允许账户zabbix能从本机连接到数据库zabbix
Mysql> Use Zabbix
Mysql>source/var/www/html/zabbix-3.2.0/database/mysql/schema.sql #导入脚本文件到zabbix数据库
Mysql>source/var/www/html/zabbix-3.2.0/database/mysql/images.sql #导入脚本文件到zabbix数据库
Mysql>source/var/www/html/zabbix-3.2.0/database/mysql/data.sql #导入脚本文件到zabbix数据库
[Email protected]/]# ln-s libmysqlclient.so.16.0.0 libmysqlclient.so
[Email protected]/]# ln-s libmysqlclient_r.so.16.0.0 libmysqlclient_r.so
2. Installing Zabbix
1) Add User:
[Email protected]/]# Useradd Zabbix
2) The Web environment has been installed, omitted here.
3) Install Zabbix
[Email protected]/]#
Ln-s/usr/local/lib/libiconv.so.2/usr/lib/libiconv.so.2 #添加软连接
[Email protected]/]#/sbin/ldconfig #使配置立即生效
[Email protected]/]# cd/var/www/html/zabbix-3.2.0
[Email protected] zabbix-3.2.0/]#
./configure--prefix=/usr/local/zabbix--enable-server--enable-agent--with-net-snmp--with-libcurl--enable-proxy- -with-mysql=/usr/bin/mysql_config #配置
[Email protected] Zabbix-3.2.0/]make
[[Email protected] Zabbix-3.2.0/]make Install
4) Add Zabbix service corresponding port
[[email protected]/]# vi/etc/services #编辑, add the following code at the end
# Zabbix
Zabbix-agent 10050/tcp # Zabbix Agent
Zabbix-agent 10050/UDP # Zabbix Agent
Zabbix-trapper 10051/tcp # Zabbix Trapper
Zabbix-trapper 10051/UDP # Zabbix Trapper
#说明, the services file must be a writable property
5) Modify the Zabbix configuration file
[Email protected] etc]# vi/usr/local/zabbix/etc/zabbix_server.conf
Dbname=zabbix #数据库名称
Dbuser=zabbix #数据库用户名
dbpassword=****** #数据库密码
Listenip=localhost #数据库ip地址
Alertscriptspath=/usr/local/zabbix/share/zabbix/alertscripts #zabbix运行脚本存放目录
: wq! #保存退出
Vi/usr/local/zabbix/etc/zabbix_agentd.conf
include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/
Unsafeuserparameters=1 #启用自定义key
: wq! #保存退出
6) Add Boot script
[Email protected] ~]#
Cp/var/www/html/zabbix-3.2.0/misc/init.d/fedora/core/zabbix_server/etc/rc.d/init.d/zabbix_server #服务端
[Email protected] ~]#
Cp/var/www/html/zabbix-3.2.0/misc/init.d/fedora/core/zabbix_agentd/etc/rc.d/init.d/zabbix_agentd #客户端
[Email protected] ~]# chmod +x/etc/rc.d/init.d/zabbix_server #添加脚本执行权限
[Email protected] ~]# chmod +x/etc/rc.d/init.d/zabbix_agentd #添加脚本执行权限
[Email protected] ~]# chkconfig zabbix_server on #添加开机启动
[Email protected] ~]# chkconfig zabbix_agentd on #添加开机启动
7) Modify the Zabbix installation directory in the Zabbix boot script
[Email protected] ~]#
Vi/etc/rc.d/init.d/zabbix_server #编辑服务端配置文件
basedir=/usr/local/zabbix/#zabbix安装目录
: wq! #保存退出
Vi/etc/rc.d/init.d/zabbix_agentd #编辑客户端配置文件
basedir=/usr/local/zabbix/#zabbix安装目录
: wq! #保存退出
3. Configure the Web site
[[Email protected] ~] #cd/var/www/html/zabbix-3.2.0
[[Email protected] ~] #cp-R/var/www/html/zabbix-3.2.0/frontends/php/var/www/html/zabbix
[[Email protected] ~] #chown apache.apache-r/var/www/html/zabbix
[[Email protected] ~] #service zabbix_server start #启动zabbix服务端
[[Email protected] ~] #service zabbix_agentd start #启动zabbix客户端
4. Modify PHP configuration file Parameters
1) [[email protected] ~] #vi/etc/php.ini #编辑修改
Post_max_size =16m
Max_execution_time =300
Max_input_time =300
: wq! #保存退出
2) [[email protected] ~]# vi/etc/php-fpm.conf #编辑修改
Request_terminate_timeout = 300
: wq! #保存退出
[[Email protected] ~] #service php-fpm Reload #重启php-fpm
5. Open in Browser: browser-based installation is omitted here.
Http://117.40.239.9/zabbix
This article is from the "sky9890" blog, make sure to keep this source http://sky9896.blog.51cto.com/2330653/1852873
Zabbix Installation Document One