Install zabbix3.0 and centos7zabbix3.0 in Centos7 LAMP Environment

Source: Internet
Author: User
Tags ibm db2 php mysql snmp

Install zabbix3.0 and centos7zabbix3.0 in Centos7 LAMP Environment

Zabbix3.0 Installation notes:

1. PHP version 5.4 or later. 2. Firewall shutdown. 3. selinux shutdown. 1, Zabbix database settings
The zabbix database can be separated from the zabbix server and uses a dedicated mysql server to store data. In this case, the zabbix database must be granted the relevant permissions.
(1) Enter mysql
[root@localhost lanmp]# mysql -u root -p
  • 1

(2) create a zabbix database that supports utf8

mysql> create database zabbix character set utf8;
  • 1

(3) grant the corresponding permissions to the zabbix Database

mysql> grant all privileges on zabbix.* to zabbix_user@'192.168.233.128' identified by '123456';

3. Install the Zabbix Service
(1) Add zabbix users and groups

[root@localhost lanmp]# groupadd zabbix[root@localhost lanmp]# useradd -g zabbix -m zabbix
Ii. install PHP

 

Install PHP databases and other plug-ins 
# yum --enablerepo=remi,remi-php55 install php-fpm php-common php-devel php-mysqlnd php-mbstring php-mcrypt httpd php mysql mysql-server php-mysql php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-bcmath mysql-connector-odbc mysql-devel libdbi-dbd-mysql net-snmp-devel curl-devel mod_ssl mod_perl mod_auth_mysql net-snmp
View PHP version
# php -vPHP 5.5.9 (cli) (built: Feb 11 2014 08:25:33) Copyright (c) 1997-2014 The PHP GroupZend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies

 

3. Install zabbix
Install plug-ins
yum --enablerepo=remi,remi-php55 install mysql-devel libxml2-devel net-snmp-devel libcurl-devel
1. Download The zabbix 3.0 package
Wget https://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/3.0.1/zabbix-3.0.1.tar.gz // we recommend that you upload it locally
tar xf zabbix-3.0.1.tar.gz
cd zabbix-3.0.1
groupadd zabbix
useradd -g zabbix zabbix
./configure --prefix=/usr/local/zabbix --enable-server --with-mysql --with-net-snmp --with-libcurl --with-libxml2

// If the above message is displayed, the installation is successful.

Make

Make install


Pay attention to the order before and after importing data files
Zabbix-3.0.1/database/mysql
/Usr/local/mysql/bin/mysql-uzabbix-p zabbix <schema. SQL // The import sequence cannot be incorrect.
/Usr/local/mysql/bin/mysql-uzabbix-p zabbix <images. SQL
/Usr/local/mysql/bin/mysql-uzabbix-p zabbix <data. SQL

2. Edit the configuration file and start:

Logs are stored in the/tmp directory by default.

Vim/usr/local/zabbix/etc/zabbix_server.conf
------------------------------------------------------------->
DBHost = localhost
DBName = zabbix
DBUser = zabbix
DBPassword = zabbix
ListenIP = 127.0.0.1
<-------------------------------------------------------------
/Usr/local/zabbix/sbin/zabbix_server-c/usr/local/zabbix/etc/zabbix_server.conf // start the service

Check the port and start listening:

 

3. Copy the zabbix application to the WEB root directory.
cd zabbix-3.0.1/frontends/php/
cp -a . /var/www/html/zabbix/
chown -R apache.apache /var/www/html/zabbix/*
4. Configure php and start httpd:

Vim/etc/php. ini
----------------------------------------->
Date. timezone = Asia/Shanghai
Post_max_size = 16 M
Max_execution_time= 300
Max_input_time= 300
----------------------------------------->
Service httpd start

Use a browser to access http: // 192.168.19.88/zabbix and follow the prompts to install:

During database connection operations

The frontend does not match Zabbix database. Current database version (mandatory/optional): 2050061/2050061. Required mandatory version: 3000000. Contact your system administrator.

In this case, you need to delete the created zabbix library and then import the zabbix library file again. // The zabbix user I created is:zabbix_userPassword: 123456 the user manually added here is: zabbix password: zabbix for reference only. If no data is connected, the user password is incorrect.

The permission error is reported. Download the configuration file and save it to the/var/www/html/zabbix/conf/zabbix. conf. php file. If an error is returned after the configuration file is manually written, you can ignore it. Close the browser and re-open the connection. Log on to the admin account with the logon password zabbix:

Vim/var/www/html/zabbix/conf/zabbix. conf. php // or manually write the configuration
---------------------------------------------------------->
<? Php
// Zabbix GUI configuration file.
Global $ DB;

$ DB ['type'] = 'mysql ';
$ DB ['server'] = '192. 0.0.1 ';
$ DB ['Port'] = '0 ';
$ DB ['database'] = 'zabbix ';
$ DB ['user'] = 'zabbix ';
$ DB ['Password'] = 'zabbix ';

// Schema name. Used for IBM DB2 and PostgreSQL.
$ DB ['scheme'] = '';

$ ZBX_SERVER = '2017. 0.0.1 ';
$ ZBX_SERVER_PORT = '123 ';
$ ZBX_SERVER_NAME = '';

$ IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
?>

4. Enable Chinese support for zabbix

In the past, zabbix disabled Chinese support by default. We need to modify the php source file of zabbix. Modify the include/locales. inc. php file under the root directory of the site.

 
  1. # Vim include/locales. inc. php
  2. Function getLocales (){
  3. Return array (
  4. 'En _ gb' => array ('name' => _ ('English (en_GB) '), 'display' => true ),
  5. 'En _ us' => array ('name' => _ ('English (en_US) '), 'display' => true ),
  6. 'Bg _ bg '=> array ('name' => _ ('Bulgarian (bg_BG)'), 'display' => true ),
  7. 'Zh _ cn' => array ('name' => _ ('Chinese (zh_CN) '), 'display' => true ),
  8. // The original value is false. Change it to true.
  9. ...... The code is omitted ........
  10. );
  11. }

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.