Install zabbix3.2.4 and centos7zabbix3.2.4 on centos7

Source: Internet
Author: User
Tags ibm db2

Install zabbix3.2.4 and centos7zabbix3.2.4 on centos7

System: CentOS Linux release 7.2.1511 (Core)

Zabbix: 3.2.4

 

1. yum-y install httpd mysql-server mysql-devel php-mysql php-common php-mbstring php-gd php-odbc php-pear curl-devel net-snmpnet -snmp-devel perl-DBI php-xml ntpdate php-bcmath gcc * libxml2 libxml2-devel net-snmp-devel libssh2 libssh2-devel

 

Ii. Disable selinux

Sed-I "s/SELINUX \ = enforcing/SELINUX \ = disabled/g"/etc/selinux/config

Firewall-cmd -- zone = public -- add-port = 80/tcp -- permanent

Firewall-cmd -- zone = public -- add-port = 10050/tcp -- permanent

Firewall-cmd -- zone = public -- add-port = 10051/tcp -- permanent

Systemctl restart firewalld. servicce

 

3. Create a zabbix account

Groupadd zabbix

Useradd-g zabbix

 

4. Install mysql

Yum install wget-y

Wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

Rpm-ivh mysql-community-release-el7-5.noarch.rpm

Yum-y install mysql-community-server

Systemctl start mysqld. service

Systemctl enable mysqld. service

 

Set the mysql root Password

Mysql

Mysql> use mysql;

Mysql> UPDATE user SET password = password ("123.com") WHERE user = 'root ';

Mysql> UPDATE user SET password = password ("123.com") WHERE user = 'zabbix ';

Mysql> flush privileges;

Mysql> quit

 

5. Create a zabbix Database

Mysql-u root-p

Mysql> create database zabbix character set utf8;

Mysql> use zabbix;

Mysql> grant all privileges on zabbix. * to root @ localhost identified by '2017. com ';

Mysql> grant all privileges on zabbix. * to zabbix @ localhost identified by '2017. com ';

Mysql> flush privileges;

Mysql> quit

 

6. Download The zabbix installation zabbix-3.2.4

Tar zxvf zabbix-3.2.4.tar.gz

Cd zabbix-3.2.4

 

Enter the initial data of zabbix to the mysql database. The following three steps will prompt you to enter the password of zabbix;

Mysql-uroot-p zabbix <database/mysql/schema. SQL

Mysql-uroot-p zabbix <database/mysql/images. SQL

Mysql-u root-p zabbix <database/mysql/data. SQL

 

 

VII. Compile and install zabbix

. /Configure-sysconfdir =/usr/local/zabbix -- bindir =/usr/local/zabbix/bin -- sbindir =/usr/local/zabbix/sbin -- sysconfdir =/usr/local /zabbix/etc -- enable-server -- enable-agent -- with-mysql -- enable-ipv6 -- with-net-snmp -- with-libcurl -- with-libxml2

Make

Make install

 

8. Create a zabbix log directory

Mkdir/var/log/zabbix

Chown zabbix. zabbix/var/log/zabbix

 

9. Add the startup script:

 

Ln-s/usr/local/zabbix/sbin/zabbix _ */usr/local/sbin/

Cp misc/init. d/fedora/core/zabbix _ */etc/init. d/

Chmod 744/etc/init. d/zabbix _*

 

Change the zabbix. pid file to the/var/log/zabbix/folder.

Sed-I "s # PIDFILE =/tmp # PIDFILE =/var/log/zabbix # g"/etc/init. d/zabbix_server

Sed-I "s # PIDFILE =/tmp # PIDFILE =/var/log/zabbix # g"/etc/init. d/zabbix_agentd

 

10. Copy the zabbix web file to the httpd directory/var/www/html

 

Cp-r./frontends/php // var/www/html/zabbix copy the corresponding file;

Chown-R apache. apache/var/www/html/zabbix change the folder group and user

Modify the configuration file/var/www/html/zabbix/conf/zabbix. conf. php:

<?php// Zabbix GUI configuration file.global $DB;$DB['TYPE']     = 'MYSQL';$DB['SERVER']   = 'localhost';$DB['PORT']     = '0';$DB['DATABASE'] = 'zabbix';$DB['USER']     = 'zabbix';$DB['PASSWORD'] = '123.com';// Schema name. Used for IBM DB2 and PostgreSQL.$DB['SCHEMA'] = '';$ZBX_SERVER      = 'localhost';$ZBX_SERVER_PORT = '10051';$ZBX_SERVER_NAME = '1.1.1.1';$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;

  

11. Configure the php. ini file to adapt to the parameters required for installation.

Vi/etc/php. ini

Date. timezone = Asia/Chongqing

Max_execution_time= 300

Max_input_time= 300

Memory_limit = 128 M

Post_max_size = 32 M

 

12. Configure the zabbix configuration file

Vi/usr/local/zabbix/zabbix_server.conf

 

LogFile =/var/log/zabbix/zabbix_server.log

PidFile =/var/log/zabbix/zabbix_server.pid

DBName = zabbix # Database Name

DBUser = root # Database logon Username

DBPassword = 123.com # Database Password

StartPollers = 30 # enable multiple threads. Generally, no more than 30 threads are allowed.

StartTrappers = 20 # Number of trapper threads

StartPingers = 10 # fping thread count

StartDiscoverers = 120

Maxhousekeeperdeleted = 5000

CacheSize = 1024 M # The number of caches used to save monitoring data. Adjust the cache Quantity Based on the number of monitoring hosts;

# Some versions are written as ValueCacheSize = 1024 M

StartDBSyncers = 8 # Database Synchronization time

HistoryCacheSize = 1024 M

TrendCacheSize = 128 M # total trend cache size

HistoryTextCacheSize = 512 M # change to VMwareCacheSize

LogSlowQueries = 1000

LogFile =/var/log/zabbix/zabbix_server.log # specify the zabbix log file storage location

# By default, all related file directories of zabbix are under tmp.

DBSocket =/var/lib/mysql. sock

 

13. Add startup and startup services

 

Chkconfig -- add zabbix_server

Chkconfig -- add zabbix_agentd

Chkconfig -- level 35 zabbix_agentd on

Chkconfig -- level 35 zabbix_server on

Systemctl enable mysqld. service

Systemctl enable httpd

Systemctl start httpd

/Etc/init. d/zabbix_server restart

/Etc/init. d/zabbix_agentd restart

 

14. Access http: // ip address/zabbix through a browser;

 

Configuration reference: http://506554897.blog.51cto.com/2823970/1766141

Error reference: http://506554897.blog.51cto.com/2823970/1766141

 

Related Article

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.