Deploying Zabbix monitoring MySQL
(1) Install LAMP Environment
[[email protected] ~]# yum-y installmysql-server http php
(2) The dependency packages required to install the Zabbix Web
[Email protected] ~]# yum-y installmysql-dev gcc net-snmp-devel curl-devel perl-dbi php-gd php-mysql php-bcmathphp-mbstr ing Php-xml
installation Fping:
[Email protected] zabbix]# wget http://www.fping.org/dist/fping-3.13.tar.gz
[Email protected] zabbix]# tar xffping-3.13.tar.gz
[Email protected] zabbix]# CD fping-3.13
[Email protected] fping-3.13]#./configure
[[email protected] fping-3.13]# make&& make install
(3) Create a Zabbix running user
[Email protected] fping-3.13]# Groupaddzabbix
[Email protected] fping-3.13]# Useradd-gzabbix Zabbix
[Email protected] fping-3.13]# chownroot:zabbix/usr/local/sbin/fping
[Email protected] fping-3.13]# chmod 4710/usr/local/sbin/fping
(4) Installing Zabbix server:
[Email protected] zabbix]# wget http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.0.2/ Zabbix-3.0.2.tar.gz
[Email protected] zabbix]# tar xfzabbix-3.0.2.tar.gz
[Email protected] zabbix]# CD zabbix-3.0.2
[Email protected] zabbix-3.0.2]#/configure--prefix=/usr/local/zabbix--enable-server--enable-agent-- Enable-proxy--with-mysql=/usr/bin/mysql_config--with-net-snmp--with-libcurl
[[email protected] zabbix-3.0.2]# make
[[email protected] zabbix-3.0.2]# make install
Zabbix Server configuration and startup
(1) Create Zabbix database and Mysql user
Mysql> Create schema Zabbix characterset UTF8;
Query OK, 1 row Affected (0.00 sec)
mysql> Create user "Zabbix" @ "%" identified by "123456";
Query OK, 0 rows Affected (0.00 sec)
Mysql> Grant all on zabbix.* to "Zabbix" @ "%";
Query OK, 0 rows Affected (0.00 sec)
Mysql> Grant all on zabbix.* to "Zabbix" @localhost identified by "123456";
mysql> flush Privileges;
Query OK, 0 rows Affected (0.00 sec)
(2) import Zabbix database initial data
[Email protected] zabbix-3.0.2]# cddatabase/mysql/
[email protected] mysql]# LL
Total dosage 3012
-rw-r--r--1 990351 4 months 18:01 data.sql
-rw-r--r--1 1978341 4 months 17:51 images.sql
-rw-r--r--1 113197 4 months 18:01 schema.sql
[Email protected] mysql]#
[email protected] mysql]# MySQL Zabbix <schema.sql
[email protected] mysql]# MySQL Zabbix <images.sql
[email protected] mysql]# MySQL Zabbix <data.sql
(3) Configuring the Zabbix configuration file
Edit The configuration file for the Zabbix server and modify the following parameters:
[Email protected] mysql]# vim/usr/local/zabbix/etc/zabbix_server.conf
[Email protected] ~]# cat/usr/local/zabbix/etc/zabbix_server.conf |egrep-v "^#|^$"
listenport=10051
Logfile=/usr/local/zabbix/logs/zabbix_server.log
Pidfile=/usr/local/zabbix/logs/zabbix_server.pid
dbhost=127.0.0.1
Dbname=zabbix
Dbuser=zabbix
dbpassword=123456
Dbsocket=/var/lib/mysql/mysql.sock
dbport=3306
Timeout=4
Fpinglocation=/usr/local/sbin/fping
logslowqueries=3000
[Email protected] ~]#
(4) Configuring Zabbix Services
Copy the Zabbix_server script from the installation directory and edit
[Email protected] ~]# CD zabbix/zabbix-3.0.2
[Email protected] zabbix-3.0.2]# cpmisc/init.d/fedora/core5/zabbix_server/etc/init.d/
[Email protected] zabbix-3.0.2]# Mkdir/usr/local/zabbix/logs
[Email protected] zabbix-3.0.2]# Chown-rzabbix.zabbix/usr/local/zabbix
[Email protected] zabbix-3.0.2]# Vim/etc/init.d/zabbix_server
[Email protected] zabbix-3.0.2]# Cat/etc/init.d/zabbix_server
Zabbix_bin= "/usr/local/zabbix/sbin/zabbix_server"
Conf_file= "/usr/local/zabbix/etc/zabbix_server.conf"
(5) Open Zabbix security Restrictions
Adjust firewall rules (open port 10051):
[[email protected] zabbix]# iptables-a input-p tcp-m tcp--dport 10051-j ACCEPT
[[Email protected] zabbix]# service Iptablessave
Iptables: Save firewall rules to /etc/sysconfig/iptables: [ OK ]
(6) Start Zabbix Server
[[email protected] zabbix]# servicezabbix_server start
is starting Zabbix Server: [ OK ]
[Email protected] zabbix]#
(7) Close Zabbix server
[[email protected] zabbix]# Servicezabbix_server stop
Stop Zabbix Server: [ OK ]
[Email protected] zabbix]#
(8) Configure Zabbix server to boot from:
[Email protected] zabbix]# chkconfig--addzabbix_server
[Email protected] zabbix]# chkconfig--level35 zabbix_server on
[Email protected] zabbix]#
Configuring The Zabbix Web service side
(1) Copy the Zabbix Web file to the Apache Web directory
in the installation directory , copy the frontends to the specified Web root directory:
[Email protected] zabbix]# CD zabbix-3.0.2
[Email protected] zabbix-3.0.2]# cp-rafrontends/php/*/var/www/html/
(2) Apache configuration
[Email protected] ~]# vim/etc/httpd/conf/httpd.conf
Servername192.168.1.214:80
(3) PHP configuration
[Email protected] ~]# Vim/etc/php.ini
Date.timezone= Asia/shanghai
memory_limit= 128M
Post_max_size= 16M
Max_execution_time= 300
Max_input_time= 300
session.auto_start= 0
Mbstring.func_overload= 1
( PHP string function overloading must be disabled. PHP string function overloading must be disabled. )
(4) Zabbix Web installation
[Email protected] ~]#/etc/init.d/httpdrestart
Stop httpd: [ OK ]
starting httpd: [ OK ]
[Email protected] ~]#
# wget http://iweb.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.4.8/zabbix-2.4.8.tar.gz
Install zabbix-3.0.2.tar.gz Web side has a problem error "PHP parseerror:syntax error, unexpected ' [' in/var/www/html/ index.php on line" from the new download zabbix-2.4.8.tar.gz the Web -side copy to the Web site root directory.
Welcome interface:
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/7F/DD/wKioL1cwUm3xiHs8AAIPVE_Vumk860.png "title=" 1.png " alt= "Wkiol1cwum3xihs8aaipve_vumk860.png"/>
PHP string function overloading must be disabled
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/7F/DD/wKioL1cwUojyCTUPAAHw--L9ze4850.png "title=" 2.png " alt= "Wkiol1cwuojyctupaahw--l9ze4850.png"/>
[Email protected] ~]# Vim/etc/php.ini
Mbstring.func_overload= 1
[Email protected] ~]#/etc/init.d/httpdrestart
Stop httpd: [ OK ]
starting httpd: [ OK ]
[Email protected] ~]#
Re-check:
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/7F/DF/wKiom1cwUczS4U6TAAGVPRmRyJ8399.png "title=" 3.png " alt= "Wkiom1cwuczs4u6taagvprmryj8399.png"/>
Fill in the Database information:
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/7F/DF/wKiom1cwUd-zhGfUAAGDe4yUaSU154.png "title=" 4.png " alt= "Wkiom1cwud-zhgfuaagde4yuasu154.png"/>
Error occurred:
[ cause of problem ] Zabbix Database version is incorrect ( because SQL is imported in Zabbix-3.2)
re-import after confirmation Zabbix Database SQL is not imported here, and then the 3.0.2 Web in the copy to the Web root directory, modify just the error index.php, If you are not able to import again.
Experiment, and you have to re-import the data. There are too many files to replace.
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/7F/DD/wKioL1cwUtHgzJxhAAGl2hImhsA795.png "title=" 5.png " alt= "Wkiol1cwuthgzjxhaagl2himhsa795.png"/>
[Email protected] zabbix]# CD zabbix-2.4.8
[Email protected] zabbix-2.4.8]# cddatabase/mysql/
[[email protected] mysql]# ls
Data.sql Images.sql Schema.sql
[Email protected] mysql]# mysql-uzabbix-p123456 Zabbix < Schema.sql
[Email protected] mysql]# mysql-uzabbix-p123456 Zabbix < Images.sql
[Email protected] mysql]# mysql-uzabbix-p123456 Zabbix < Data.sql
[Email protected] mysql]#
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/7F/DF/wKiom1cwUhPAFtKIAAGfK72wQ0I996.png "style=" float: none; "title=" 6.png "alt=" Wkiom1cwuhpaftkiaagfk72wq0i996.png "/>
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/7F/DF/wKiom1cwUhTCmVajAAErIYGeoc8394.png "style=" float: none; "title=" 7.png "alt=" Wkiom1cwuhtcmvajaaeriygeoc8394.png "/>
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/7F/DF/wKiom1cwUhaj_Ev4AAGBZIVTaRQ960.png "style=" float: none; "title=" 8.png "alt=" Wkiom1cwuhaj_ev4aagbzivtarq960.png "/>
manually copy zabbix.conf.php to /var/www/html/zabbix/conf
[Email protected] html]# cpconf/zabbix.conf.php.example conf/zabbix.conf.php
The zabbix.conf.php file format reads as follows:
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/7F/DD/wKioL1cwUyWAJbv3AABZzgIsfxc841.png "style=" float: none; "title=" 9.png "alt=" Wkiol1cwuywajbv3aabzzgisfxc841.png "/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/7F/DD/wKioL1cwUyeiL-JAAAGAr8isXJE959.png "style=" float: none; "title=" 10.png "alt=" Wkiol1cwuyeil-jaaagar8isxje959.png "/>
Deploy Zabbix monitor MySQL (a) Install Zabbix