Zabbix-distributed monitoring platform

**

Initial configuration of Zabbix host

**
Network Card

[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens32 

Insert picture description here

[root@localhost ~]# vim /etc/hostname
zbx.sevenwin.org
[root@localhost ~]# vim /etc/hosts
10.0.0.12 zbx zbx.sevenwin.org
[root@localhost ~]# vim /etc/selinux/config
SELINUX=disabled

Insert picture description here

**

Deploy LAMP

**
Install Apache and mariadb

[root@zbx ~]# yum -y install httpd
[root@zbx ~]# yum -y install mariadb-server 
[root@zbx ~]# systemctl start httpd.service 
[root@zbx ~]# systemctl enable httpd.service
[root@zbx ~]# systemctl start mariadb.service 
[root@zbx ~]# systemctl enable mariadb.service

Deploy LAMP
install PHP

[root@zbx ~]# yum -y install php

Install PHP components to make PHP support MariaDB

[root@zbx ~]# yum -y install php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-bcmath php-mhash

Restart MariaDB, Apache

[root@zbx ~]# systemctl restart mariadb.service
[root@zbx ~]# systemctl restart httpd.service

Deploy zabbix

Install the "Zabbix installation package" resource repository

[root@zbx ~]# rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm

Insert picture description here

Install Zabbix

[root@zbx ~]# yum install -y zabbix-server-mysql zabbix-agent zabbix-web-mysql 
[root@zbx ~]# yum install centos-release-scl -y

Initialize the database and create the Zabbix database

[root@zbx ~]# mysqladmin -u root password 9865321
[root@zbx ~]# mysql -uroot -p
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'Z9865321';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> quit

Insert picture description here

[root@zbx ~]# zcat /usr/share/doc/zabbix-server-mysql-*/create.sql.gz | mysql -uroot zabbix -p

Insert picture description here

Edit the Zabbix database configuration file and start the Zabbix service

[root@zbx ~]# vim /etc/zabbix/zabbix_server.conf
DBHost=localhost           //第81行 
DBName=zabbix            //第91行 
DBUser=zabbix             //第107行 
DBPassword=Z9865321     //第115行
[root@zbx ~]# systemctl start zabbix-server
[root@zbx ~]# systemctl enable zabbix-server

Modify /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
Insert picture description here

Configure firewall

[root@zbx ~]# firewall-cmd --permanent --zone=public --add-port=10051/tcp
[root@zbx ~]# firewall-cmd --zone=public --add-port=10051/tcp
[root@zbx ~]# firewall-cmd --permanent --zone=public --add-port=80/tcp
[root@zbx ~]# firewall-cmd --zone=public --add-port=80/tcp

Start Zabbix server and agent

[root@zbx ~]# systemctl restart zabbix-server zabbix-agent httpd
[root@zbx ~]# systemctl enable zabbix-server zabbix-agent httpd

Continue installation in WebUI

[root@zbx ~]# firefox http://127.0.0.1/zabbix

Insert picture description here
Check the prerequisites.
Insert picture description here
Configure the database connection.
Insert picture description here
Configure the server details.
Insert picture description here
Summary of the pre-installation. The
Insert picture description here
installation is complete
Insert picture description here
. Log in to the
Insert picture description here
WebUI main interface in the WebUI.
Insert picture description here
Click "Personal Configuration" in the upper right corner to change the language to Chinese
Insert picture description here

Monitored end (Agent) configuration

Installation and configuration of Linux Agent

[root@localhost ~]# rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
[root@localhost ~]# yum -y install zabbix-agent
[root@localhost ~]# vim /etc/zabbix/zabbix_agentd.conf
Server=10.0.0.12                  //第95行 
ServerActive=10.0.0.12           //第136行
[root@localhost ~]# chkconfig zabbix-agent on
[root@localhost ~]# service zabbix-agent restart
[root@localhost ~]# iptables -I INPUT -p tcp --dport 10050 -j ACCEPT
[root@localhost ~]# systemctl stop firewalld.service 

Add a host to add a service on the server side
Insert picture description here
Insert picture description here
Insert picture description here
, for example: MySQL

Insert picture description here
Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/caodabener/article/details/112180908