IP Address: 192.168.21.127
Web environment: nginx+mysql+php
Zabbix version: Zabbix 2.2 LTS
Note: Linux installation Zabbix need to have lamp or LNMP operating environment
First, create, import Zabbix database
CD/USR/LOCAL/SRC #进入软件包下载目录
Tar zxvf zabbix-2.2.6.tar.gz #解压
Cd/usr/local/src/zabbix-2.2.6/database/mysql #进入mysql数据库创建脚本目录
LS #列出文件, you can see that there are Schema.sql, Images.sql, data.sql these three files
Mysql-u root-p #输入密码, enter MySQL console
Create database Zabbix character set UTF8; #创建数据库zabbix, and database encoding uses UTF8
Insert into Mysql.user (Host,user,password) VALUES (' localhost ', ' Zabbix ', Password (' 123456 ')); #新建账户zabbix, Password 123456
Flush privileges; #刷新系统授权表
Grant all in zabbix.* to ' Zabbix ' @ ' 127.0.0.1 ' identified by ' 123456 ' with GRANT option; #允许账户zabbix能从本机连接到数据库zabbix
Flush privileges; #再次刷新系统授权表
Source/usr/local/src/zabbix-2.2.6/database/mysql/schema.sql #导入脚本文件到zabbix数据库
Source/usr/local/src/zabbix-2.2.6/database/mysql/images.sql #导入脚本文件到zabbix数据库
Source/usr/local/src/zabbix-2.2.6/database/mysql/data.sql #导入脚本文件到zabbix数据库
Note: Please import in the order above, otherwise there will be an error.
Mysql-uzabbix-p123456-hlocalhost Zabbix </usr/local/src/zabbix-2.2.6/database/mysql/schema.sql
Mysql-uzabbix-p123456-hlocalhost Zabbix </usr/local/src/zabbix-2.2.6/database/mysql/images.sql
Mysql-uzabbix-p123456-hlocalhost Zabbix </usr/local/src/zabbix-2.2.6/database/mysql/data.sql
Cd/usr/lib64/mysql #32位系统为 /usr/lib/mysql, note that the system version is the same, the file version may be different, this is 16.0.0
Ln-s libmysqlclient.so.16.0.0 libmysqlclient.so #添加软连接
Ln-s libmysqlclient_r.so.16.0.0 libmysqlclient_r.so #添加软连接
Groupadd Zabbix #创建用户组zabbix
Useradd zabbix-g zabbix-s/bin/false #创建用户zabbix and adds user Zabbix to the user group Zabbix
2, install the dependent package #CentOS使用yum命令安装
Yum Install Net-snmp-devel Curl Curl-devel mysql-devel
Note: If the above package is installed when you install the Web environment lamp or LNMP, this step can be ignored
cd/usr/local/src/zabbix-2.2.6 #进入安装目录
./configure--prefix=/usr/local/zabbix--enable-server--enable-agent--with-net-snmp--with-libcurl--enable-proxy- -with-mysql=/usr/bin/mysql_config #配置
Description: Find/-name mysql_config search location, if there is no mysql_config, you need to install Yum install Mysql-devel
4, add the Zabbix service corresponding port
Vi/etc/services #编辑, add the following code at the end
Zabbix-agent 10050/tcp # Zabbix Agent
Zabbix-agent 10050/UDP # Zabbix Agent
Zabbix-trapper 10051/tcp # Zabbix Trapper
Zabbix-trapper 10051/UDP # Zabbix Trapper
5, modify the Zabbix configuration file
Vi/usr/local/zabbix/etc/zabbix_server.conf
listenip=127.0.0.1 #数据库ip地址
Alertscriptspath=/usr/local/zabbix/share/zabbix/alertscripts #zabbix运行脚本存放目录
Cp/usr/local/src/zabbix-2.2.6/misc/init.d/fedora/core/zabbix_server/etc/rc.d/init.d/zabbix_server #服务端
Cp/usr/local/src/zabbix-2.2.6/misc/init.d/fedora/core/zabbix_agentd/etc/rc.d/init.d/zabbix_agentd #客户端
chmod +x/etc/rc.d/init.d/zabbix_server #添加脚本执行权限
chmod +x/etc/rc.d/init.d/zabbix_agentd #添加脚本执行权限
Chkconfig Zabbix_server on #添加开机启动
Chkconfig Zabbix_agentd on #添加开机启动
7, modify Zabbix boot boot script in the Zabbix installation directory
Vi/etc/rc.d/init.d/zabbix_server #编辑服务端配置文件
basedir=/usr/local/zabbix/#zabbix安装目录
Vi/etc/rc.d/init.d/zabbix_agentd #编辑客户端配置文件
basedir=/usr/local/zabbix/#zabbix安装目录
Iv. Configuring the Web site
cd/usr/local/src/zabbix-2.2.6
Cp-r/usr/local/src/zabbix-2.2.6/frontends/php/usr/local/nginx/html/zabbix
Chown Www.www-R/usr/local/nginx/html/zabbix
Note:/usr/local/nginx/html for nginx default site Directory www for nginx run account
Service Zabbix_server Start #启动zabbix服务端
Service Zabbix_agentd Start #启动zabbix客户端
Vi. modifying PHP configuration file parameters
2, vi/usr/local/php/etc/php-fpm.conf #编辑修改
Request_terminate_timeout = 300
Service PHP-FPM Reload #重启php-fpm
http://192.168.21.127/zabbix/setup.php
Check system environment settings, all must be OK to continue
Configuring MySQL Database Information
Database port:use Default Port
Test connection #测试数据库连接是否正常, show OK by
Finish installation Complete
Viii. change Zabbix The default language is Simplified Chinese, replacing the system default Chinese font on the monitor image
1, modify the system configuration file, so that the Web page support Simplified Chinese display
vi/usr/local/nginx/html/zabbix/include/locales.inc.php #编辑修改
' ZH_CN ' => Array (' name ' => _ (' Chinese (zh_cn) '), ' display ' => false),
' ZH_CN ' => Array (' name ' => _ (' Chinese (zh_cn) '), ' Display ' => true),
2, replace the monitor image on the system default font #默认字体不支持中文, if not replaced, the image will display garbled
Copy a Chinese font file in the C:windowsfonts directory in the Windows system, such as Msyh.ttf
Upload the font file Msyh.ttf to the Zabbix site root directory Fonts folder
For example:/usr/local/nginx/html/zabbix/fonts
Backing up the default font file: Dejavussans.ttf-bak
Modify Msyh.ttf name called Dejavussans.ttf
Http://192.168.21.127/zabbix
As shown in the following figure
As shown in the following figure
Language:chinese (ZH_CN) #简体中文
Exit the site, and then log back on, as shown in the following figure
The default interface is already displayed in Chinese
At this point, the Zabbix installation illustrated tutorial is complete.