English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Firstly, the Zabbix system runs based on the PHP environment, so the premise is that there is a PHP running environment on the system, lnmp or lamp environment can both be used
If you are not familiar with the installation of PHP environment under Linux, perhaps the following two articles will be helpful to you
lnmp environment installation: https://www.oldtoolbag.com/article/97754.htm
lamp environment installation: https://www.oldtoolbag.com/article/68480.htm
Please confirm that the PHP environment in your system can run normally
Firstly, let's introduce Zabbix
Firstly,Characteristics of Zabbix
Data collection
;8195;8195Availability and performance checks
;8195;8195Supports SNMP (including capture and active polling), IPMI, JMX, VMware monitoring
;8195;8195Custom checks
;8195;8195Collects the required data at a custom interval
;8195;8195Executed by Server/Proxy and agents
Flexible threshold definition
Highly configurable alerts
Real-time chart drawing
Using the built-in chart drawing function, the content of the monitoring items can be immediately drawn into a chart
Web monitoring function
Supports custom graphics
Rich visualization options
Multiple monitoring items are displayed in one view
Network topology diagram
Based on template grouping check
Secure user authentication
Written in C language, with high performance
Secondly,Zabbix composition
Zabbix server
;8195;8195Zabbix Server is the core storage for all configuration information, statistical information, and operational data. It is used for reporting system availability, system integrity, and statistical information, etc.
Zabbix data storage end
Configuration information and data collected by Zabbix are stored in the database, supporting mysql, pg, oracle.
Zabbix Web presentation end
It provides a web-based access interface (written in PHP)
Zabbix client
;8195;8195;Zabbix agents monitoring proxy deployed on the monitoring target can actively monitor local resources and applications, and report the collected data to Zabbix Server.
Zabbix Proxy agent server
;8195;8195;Zabbix proxy can collect performance and availability data on behalf of Zabbix Server. The Proxy agent is an optional part of the Zabbix software deployment; of course, the Proxy agent can also help distribute the load pressure on a single Zabbix Server.
3.Zabbix typical architecture deployment diagram
4.Install Zabbix
View the CentOS version number
# more /etc/redhat-release ## Demonstration environment CentOS Linux release 7.4.1708 (Core)
Disable selinux
# vi /etc/selinux/config ## Disable selinux SELINUX=disabled # setenforce 0
Install mariadb database, if you have already installed MYSQL, this step can be skipped (mariadb is a branch of MYSQL, with the same functions as MYSQL)
# yum install mariadb-server mariadb -y ## Install mariadb database # systemctl start mariadb # systemctl enable mariadb
Add zabbix yum repository, install zabbix server and web management
## Add zabbix yum repository, install zabbix server and web management # rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm # yum install zabbix-server-mysql zabbix-web-mysql -y
Log in to mysql to create a database and directory
# mysql ## Log in to mysql to create a database and directory Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 3 Server version: 5.5.56-MariaDB MariaDB Server MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin; Query OK, 1 row affected (0.00 sec) MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix#'1235; Query OK, 0 rows affected (0.00 sec)
Add Zabbix metadata to mariadb
##Add Zabbix metadata to mariadb # zcat /usr/share/doc/zabbix-server-mysql-3.4.4/create.sql.gz | mysql -uzabbix -pzabbix#1235 zabbix
5.Configure Zabbix
# cp /etc/zabbix/zabbix_server.conf /etc/zabbix/zabbix_server.conf.1121 ##First make a backup of the original file # vim /etc/zabbix/zabbix_server.conf ##Use default configuration, just set the database password DBPassword=zabbix#1235 # vim /etc/httpd/conf.d/zabbix.conf ##Modify the Apache Zabbix time zone php_value date.timezone Asia/Shanghai # cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bk # vim /etc/httpd/conf/httpd.conf ##Author : Leshami Listen 3080 ##Here a non-default80 port ##Blog : http://blog.csdn.net/leshami
Start related services
# systemctl start zabbix-server.service # systemctl enable zabbix-server.service # systemctl start httpd # systemctl enable httpd # netstat -nltp|egrep "zabbix|httpd|mysql" tcp 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 15720/zabbix_server tcp 0 0 0.0.0.0:3080 0.0.0.0:* LISTEN 15385/httpd tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 14146/mysqld tcp6 0 0 :::10051 :::* LISTEN 15720/zabbix_server
Firewall configuration
# firewall-cmd --add-port=3080/tcp --permanent ## Add WEB port # firewall-cmd --add-port=10051/tcp --permanent ## Add Zabbix_server port # systemctl reload firewalld.service
6.Zabbix GUI installation and configuration
Open the browser, enterhttp://IP:3080/zabbix
Configure the basic information of the Zabbix database and the Zabbix administrator account and password
Set the IP, port, and name of the Zabbix server
7.Zabbix client installation and configuration
For the Zabbix server, it can also be monitored itself. For self-monitoring, the agent should also be installed
For the installation of agents on non-local machines, it is recommended to configure the yum source first, then install the agent, and modify the agent configuration file to point to the server
# yum install zabbix-agent -y # systemctl enable zabbix-agent.service agent configuration [root@ydq-mnt zabbix]# vim /etc/zabbix/zabbix_agentd.conf Server=127.0.0.1,10.80.234.38 ServerActive=127.0.0.1,10.80.234.38 # systemctl start zabbix-agent.service
8. Some things to note
1Before installation, it is recommended to configure the server and client/etc/hosts file, add the mapping relationship between the server and client host IP to the current host
2Use the same Hostname in the server and agent configuration files, case sensitive. Otherwise, it may be difficult to connect
3Open firewall ports, open ports for non-local agent10050
Up to now Zabbix3.4 The basic installation is successful, detailed usage methods can be found on our website