The fourth installment of Zabbix under CentOs7

This article is the source installation method, please refer to the following articles for yum installation method
Zabbix installation tutorial under CentOs7-preparationsZabbix installation tutorial under CentOs7-zabbix server installationZabbix installation tutorial under CentOs7 ——Zabbix agent installation and front-end configuration

I am here to use the source code to install zabbix, the system is CentOs7, and the zabbix version is 3.2.1

The installation of zabbix requires a LAMP environment

# yum install php php-gd php-mysql php-bcmath php-mbstring php-xml curl curl-devel net-snmp   net-snmp-devel perl-DBI
# yum install httpd mariadb*

Database configuration

# systemctl start mariadb.service
# mysql -u root -p
Enter password:                  ##Enter the MySQL password, the default is empty
 MariaDB [(none)]> create database zabbix character set utf8;##Create the database zabbix, and the database encoding uses utf8
 MariaDB [(none)]> insert into mysql.user(Host,User,Password)values('localhost','zabbix',password('zabbix'));       ##New account zabbix, password zabbix
 MariaDB [(none)]>  flush privileges;      ##Refresh system authorization
 MariaDB [(none)]> grant all on zabbix.* to 'zabbix'@'127.0.0.1' identified by 'zabbix'with grant option;            ##Allow the account to connect to the database zabbix from this machine
 MariaDB [(none)]>  flush privileges;

First download the zabbix installation package
Download link: http://www.zabbix.com/download
I download version 3.2.1 here

tar -zxvf zabbix-3.2.1.tar.gz
cd zabbix-3.2.1

create Account

groupadd zabbix
useradd -g zabbix zabbix

Configure the source file to execute the following instructions

. /configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2

The following error may be reported at this time:
configure: error: LIBXML2 library not found
This is because the LIBXML2 file is missing
Solution:

# yum install libxml2 libxml2-devel

After executing the above instructions, start the installation:

# make
# make install

Import database

# mysql -u root -p
 MariaDB [(none)]> use zabbix;
 MariaDB [zabbix]> source /tmp/zabbix-3.2.1/database/mysql/schema.sql
 MariaDB [zabbix]> source /tmp/zabbix-3.2.1/database/mysql/images.sql
 MariaDB [zabbix]> source /tmp/zabbix-3.2.1/database/mysql/data.sql
 MariaDB [zabbix]> quit

Note: Please import in the above order, otherwise there will be errors.

Copy relevant configuration files to /etc and make relevant configuration modifications

# mkdir -p /etc/zabbix
# cp -r zabbix-2.4.5/conf/* /etc/zabbix/
# chown -R zabbix:zabbix /etc/zabbix
# ln -s /usr/local/zabbix/etc /etc/zabbix/
# ln -s /usr/local/zabbix/bin/* /usr/bin/
# ln -s /usr/local/zabbix/sbin/* /usr/sbin/

Modify zabbix_server.conf

# vi /etc/zabbix/zabbix_server.conf

Modify the place:
LogFile=/tmp/zabbix_server.log ##Log file address
DBHost=localhost ##Database host
DBName=zabbix ##Database name
DBUser=zabbix ##Database user name
DBPassword=zabbix ##Database password
ListenIP=127.0.0.1 ##Database IP address
AlertScriptsPath=/usr/local/zabbix/share/zabbix/alertscripts##zabbix run script storage directory

After the modification is completed, you can use the following command to view the modified place

# cat  /etc/zabbix/zabbix_server.conf|grep -n ^[^#]

Modify zabbix_agentd.conf

# vi /etc/zabbix/zabbix_agentd.conf

Modify the following places:
PidFile=/tmp/zabbix_agentd.pid ##Process PID
LogFile=/tmp/zabbix_agentd.log ##Log save location
EnableRemoteCommands=1 ##Allow the execution of remote commands
Server=127.0.0.1 ##agent-side ip
ServerActive=127.0.0.1
Hostname=Zabbix server ##Must be the same as the hostname created by zabbix
Include=/usr/local/etc/zabbix_agentd.conf.d/
UnsafeUserParameters=1 ##Start custom key

Modify PHP related parameters

 vi /etc/php.ini

Modify the following places:
max_execution_time = 300
max_input_time = 300
memory_limit = 128M
upload_max_filesize = 2M
date.timezone = Asia/Shanghai
post_max_size = 28M

Configure web site

# cd zabbix-3.2.1
# cp -r frontends/php /var/www/html/zabbix

Modify the parameters of httpd.conf

 # vi /etc/httpd/conf/httpd.conf

amend as below:

< IfModule dir_module>
  DirectoryIndex index.html index.php
 < /IfModule>

Turn off SELinux:

a. Temporarily shut down (no need to restart the machine):

# setenforce 0                       ##Set SELinux into permissive mode (close SELinux)
# setenforce 1                       ##Set SELinux into enforcing mode (enforcing SELinux)

b. Modifying the configuration file requires restarting the machine:

# vi /etc/selinux/config  #SELINUX=enforcing changed to SELINUX=disabled need to restart the machine

After the above steps are completed, you can enter the web interface for installation and configuration operations, open the browser and enter http://zabbix server host/zabbix. I did not keep screenshots during the previous installation, so it is not easy to explain here, everyone You can look at the configuration interface on the Internet. Basically, the previous steps are okay. The configuration here is basically okay. If you have the opportunity to make up later!

Recommended Posts

The fourth installment of Zabbix under CentOs7
Construction of Zabbix monitoring platform under CentOS7
The actual combat of rpm packaging under CentOS6
Modify the default encoding of mysql5.6 under CentOS7
Installation under centos6.9 of jenkins learning
Install the latest OpenCV4.3 under Centos8
Tutorial diagram for installing zabbix2.4 under centos6.5
Installation and use of Mysql under CentOS
Installation and configuration of redis under centos7
Centos install the latest version of cmake
Centos 8.1.1911 solves the problem of yum reinstallation
Zabbix installation and deployment and localization under CentOS
[Centos8] The bumpy process of installing docker
Expand the disk size of Ubuntu under VMware
Summarize the knowledge points of Centos7 system reinforcement
CentOS 7.4 install Zabbix 3.4
Centos7.5 expands the space size under the root directory
CentOS 7.3 install Zabbix3
Installation and configuration of rsync server under CentOS 6.5
centos 6.5 install zabbix 4.4
Explain the implementation of Centos8 static IP configuration
Non-Root installation of Microsoft R Open under Centos
Distributed deployment of Apollo configuration center under CentOS8
From installation to entry of FastDFS under Centos7
[Video] Teach you how to install the latest Linux version of QQ under Centos 8
Centos7 adjusts the size of the root directory mount partition
Installation and cracking of confluence6.3 operation records under Centos
Installation and cracking of Jira7 operation records under Centos
Environment configuration of JDK, mysql and tomcat under Centos7
Online expansion of file system by LVM under Centos7
CentOS7.3 64 bit, build Zabbix3.4
Compile Hadoop-2.7.6 under CentOS7.4
Zabbix 2.2.20 installation details (Centos6.9)
Install mysql5.7 under CentOS7
Install ActiveMQ under Centos7
Install PostgreSQL12 under CentOS7
Explore Zabbix 5.0 LTS - CentOS 8 (1)
Install CentOS under VMware
Deploy JDK+Tomcat8 under CentOS
Graphical installation of CentOS8
Install mysql under Centos 7
Configure lamp under centos6.8
Install Jenkins under Centos 7
Redis3 installation under Centos7
Install MariaDB under MariaDB Centos7
Install mysql5.1 under CentOS6.5
Centos 7 install Zabbix 3.4 original
The problem of MySQL import file failure in CentOS environment
Detailed explanation of Spark installation and configuration tutorial under centOS7
Deployment of vulnerability scanning and analysis software Nessus under CentOS
Basic usage and examples of yum under Liunx (centos8) (recommended)
Set the network card to bridge mode under CentOS6.3 KVM
Deploy the open source continuous integration tool Jenkins under CentOS7