当前位置:网站首页>[learn ZABBIX from scratch] I. Introduction and deployment of ZABBIX
[learn ZABBIX from scratch] I. Introduction and deployment of ZABBIX
2022-06-24 14:11:00 【It's a bubble】

Zabbix Introduction and subordinates of
- Preface
- What is monitoring
- Zabbix Deploy
- 1. Download source , To configure yum
- 2. install zabbix The service side and zabbix-web front end
- 3. install mariadb, establish zabbix library , to grant authorization zabbix user
- 4. Configuration to start zabbix-server
- 5. modify Zabbix Front-end PHP To configure , And start the httpd
- 6. front end zabbix-web Installation
- At the end
Preface
Hello everyone ,docker After the end of the article, I thought hard for a long time and didn't know what to do , After reading it, I don't think there are many articles on monitoring , So I came to write zabbix The article , Prometheus' words will go to the back ,zabbix It is also a very interesting thing , If you haven't learned it, you can learn it together , This thing is relatively simple , visualization , What you have learned can be used as a review , No more nonsense , Let's get down to business .
What is monitoring
Monitoring means monitoring , Control means , With monitoring, we can make reminders before some tragedies happen and solve them in time , Prevent tragedies from happening . For example, the computer room is overheated , Monitoring reminder , Turn on the air conditioner , Prevent tragedy from happening .
With the increase of users , The service may be blocked by the system at any time oom out of memory out of memory , How do you judge ,web The service is due to excessive user access , Reached the bottleneck ? Or program code bug As a result of , Too much memory ? To prevent this , We usually have two guarantees , One is to conduct a stress test before the website goes online , Second, monitoring , For example, this website can bear up to 3000 User access , We should set up a 70%-80% Monitoring of , When user access exceeds the capacity of the server 70% even to the extent that 80% When , We need to expand the capacity ! If not, then , Wait until it's almost full before expanding ? It's too late !
Zabbix Deploy
zabbix It's very interesting , Two versions , One LTS The version will support five years , A standard version only supports seven months , So the official website is usually updated every six months . Here we use zabbix4.0 Version of the .
1. Download source , To configure yum
zabbix Official website The visit was slow
because zabbix It's slow to download on the official website , And access is slow , The source of Tsinghua is used here .wget https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
I found the address, too , You can see url Find the copy link by yourself wget It's fine too , You can use mine .
And then we decompress
rpm -ivh zabbix-release-4.0-2.el7.noarch.rpm
Configure after decompression yum Warehouse
vim /etc/yum.repos.d/zabbix.repo
We need to take baseurl= The front of this line is changed to Tsinghua ! After comparison, it can be found that Tsinghua has only changed in the front
https://mirrors.tuna.tsinghua.edu.cn/zabbix
So we just need to replace here
%s#http://repo.zabbix.com#https://mirrors.tuna.tsinghua.edu.cn/zabbix#g
Then take it. gpgcheck Such as 0, In the end the following
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
[zabbix-debuginfo]
name=Zabbix Official Repository debuginfo - $basearch
baseurl=https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/debuginfo
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
gpgcheck=0
[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=0
2. install zabbix The service side and zabbix-web front end
Here we need to change the image source to Ali , Otherwise, an error will be reported without dependency
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
yum makecache
# Installation services and web
yum install zabbix-server-mysql zabbix-web-mysql -y
3. install mariadb, establish zabbix library , to grant authorization zabbix user
Here are instructions , We'll just keep going .
yum install mariadb-server -y
systemctl start mariadb
systemctl enable mariadb
mysql_secure_installation
Enter this command and press enter , then n, Then all the way y That's it , This is used to delete anonymous users
mysql
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
MariaDB [(none)]> grant all privileges on zabbix.* to [email protected] identified by '123456';
# Modify character set Build table Authorization, etc
sign out mariadb Import zabbix Table structure and initial data
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p123456 zabbix
Check zabbix Whether the library is imported successfully
mysql -uroot zabbix -e 'show tables'
If the table appears, it is successful
4. Configuration to start zabbix-server
Let's modify the configuration file here
vim /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=123456
Just make these four the same as mine , Sure :/ lookup .
start-up zabbix-server
systemctl start zabbix-server
systemctl enable zabbix-server
Check the service
netstat -lntup
If you can see zabbxi.server That's success , If there is no and no error is reported , That means your service is started but the listening port is not , Connect the firewall and selinux Try shutting down and restarting .
setenforce 0
getenforce
systemctl stop firewalld.service
If not , It's just zabbix Found in the installation directory of etc/zabbix_server.conf file , take ListenIP=0.0.0.0 Remove the previous comment
5. modify Zabbix Front-end PHP To configure , And start the httpd
vim /etc/httpd/conf.d/zabbix.conf
find php_value date.timezone This business , Change the time zone to
php_value date.timezone Asia/Shanghai
Start up after saving and start up automatically
systemctl start httpd
systemctl enable httpd
6. front end zabbix-web Installation
Then we visit http://ip/zabbix That's all right. ! Follow the prompts on the web page to register .
The login account and password are as follows
Admin
zabbix
Later revision zabbix Database password , Configuration files that need to be modified :
/etc/zabbix/web/zabbix.conf.php
You can see that the interface is like this !
At the end
If my article helps you , I hope you can give me a concern , give the thumbs-up , Let's support it , This will be my motivation to update , At present, we are updating to learn from scratch zabbix, Prepare to update and learn from scratch kubernetes, Thank you for your support !
边栏推荐
- 21set classic case
- 90% of the project managers have skipped the pit. Are you still in the pit?
- Return to new list
- #21Set经典案例
- Baidu map API drawing points and tips
- 【深度学习】NCHW、NHWC和CHWN格式数据的存储形式
- 返回新列表
- How to solve the problem that iterative semi supervised training is difficult to implement in ASR training? RTC dev Meetup
- Record various sets of and or of mongotemplate once
- One click to generate University, major and even admission probability. Is it so magical for AI to fill in volunteer cards?
猜你喜欢

从谭浩强《C程序设计》上摘录的ASCII码表(常用字符与ASCII代码对照表)

HarmonyOS. two

鲲鹏arm服务器编译安装PaddlePaddle

如何在物联网低代码平台中进行任务管理?

Rongyun communication has "hacked" into the heart of the bank

How to manage tasks in the low code platform of the Internet of things?

Kunpeng arm server compilation and installation paddlepaddle

龙蜥开发者说:首次触电,原来你是这样的龙蜥社区? | 第 8 期

Second, the examinee must see | consolidate the preferred question bank to help the examinee make the final dash

MySQL复合索引探究
随机推荐
English writing of Mathematics -- Basic Chinese and English vocabulary (common vocabulary of geometry and trigonometry)
Rasa 3.x 学习系列-非常荣幸成为 Rasa contributors 源码贡献者,和全世界的Rasa源码贡献者共建共享Rasa社区!
Three efficient programming skills of go language
Kotlin shared mutable state and concurrency
初识云原生安全:云时代的最佳保障
杰理之增加一个输入捕捉通道【篇】
2022质量员-设备方向-通用基础(质量员)考试题及答案
2022年煤炭生产经营单位(安全生产管理人员)考试题模拟考试平台操作
知识经济时代,教会你做好知识管理
二造考生必看|巩固优选题库助力考生最后冲刺
Rongyun communication has "hacked" into the heart of the bank
Record various sets of and or of mongotemplate once
杰理之检测 MIC 能量自动录音自动播放参考【篇】
Autorf: learn the radiation field of 3D objects from single view (CVPR 2022)
二叉树中最大路径和[处理好任意一颗子树,就处理好了整个树]
Daily question 8-515 Find the maximum value in each tree row
居家办公更要高效-自动化办公完美提升摸鱼时间 | 社区征文
Jerry has opened a variety of decoding formats, and the waiting time from card insertion to playback is long [chapter]
Home office should be more efficient - automated office perfectly improves fishing time | community essay solicitation
Jerry's test mic energy automatic recording automatic playback reference [article]