当前位置:网站首页>ZABBIX monitoring of lamp architecture (2): ZABBIX basic operation
ZABBIX monitoring of lamp architecture (2): ZABBIX basic operation
2022-07-03 04:47:00 【Wang Duoyu, I'm your second master】
Catalog
One 、zabbix Add and delete monitoring nodes
(3) Batch add according to conditions
Two 、 Application specific zabbix monitor
One 、zabbix Add and delete monitoring nodes
Experimental instructions :server5 In the last experiment, it has been added as zabbix The node , Now need server2 and server3, among , Manually add server2, Automatic addition server3
scp /etc/yum.repos.d/zabbix.repo [email protected]:~
scp /etc/yum.repos.d/zabbix.repo [email protected]:~
(1) Manually add
server2:
mv zabbix.repo /etc/yum.repos.d/
vim /etc/yum.repos.d/zabbix.repo Revise it key, Because there is no key, Before server5 When installing, it is directly installed key.
yum install -y zabbix-agent Install the software
cd /etc/zabbix/
vim zabbix_agentd.conf
############################
117 Server=172.25.73.5
158 ServerActive=172.25.73.5
169 Hostname=server2
##############################
systemctl enable --now zabbix-agent.service
Browser input http://172.25.73.5/zabbix/
To configure -> host -> Create a host
Add information
Click Add , The following page appears , At this time, we found that server2 Of Availability is not on
To configure -> host ->server2-> Templates
choice Template. find Template OS Linux by Zabbix agent
Click Update
Refresh the page , Found that usability turned green
(2) Automatic addition
server3 and server2 Same operation
Software warehouse modification key
Install the software
Modify the configuration file
Start the service
Browser input http://172.25.73.5/zabbix/
To configure -> action ->Discovery actions
Select the item below , Select enable
To configure -> Auto discovery -> Auto discovery -> Click on local network Edit the rules
Click Update , Enable
Return to the host page , refresh , appear server3
(3) Batch add according to conditions
Delete server3 host , Disable autodiscover rules , Ban discover actions
To configure -> action ->Autoregistrration actions-> Create action
Fill in actions and operations
Click Add
server3: systemctl restart zabbix-agent.service
Refresh ,sevrer3 Add success
(4) Use api Tools to manage
zabbix The official documentation for :https://www.zabbix.com/documentation/5.0/zh/manual/api
Two 、 Application specific zabbix monitor
explain : Manually add zabbix Monitoring item
Experimental environment :server2 install nginx
The host machine :scp /home/westos/Desktop/aaaalinux\ file/docs/lamp/nginx-1.20.2.tar.gz [email protected]:~
server2: install nginx
tar zxf nginx-1.20.2.tar.gz
cd nginx-1.20.2/yum install gcc pcre-devel openssl-devel -y
./configure --with-http_stub_status_module --with-http_ssl_module
make && make installln -s /usr/local/nginx/sbin/nginx /usr/local/bin/
Edit profile
vim /usr/local/nginx/conf/nginx.conf
location /status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}
nginx -t testing
nginx Turn on
here curl localhost/status The following message appears , We want to add this information to zabbix
Now? server2 Test whether there is a problem with the command , If not, write a script
curl -s http://localhost/status | grep Active | awk '{print $3}'
curl -s http://localhost/status | awk NR==3 | awk '{print $1}'
curl -s http://localhost/status | awk NR==3 | awk '{print $2}'
curl -s http://localhost/status | awk NR==3 | awk '{print $3}'
The script content : Note the script location
UserParameter=nginx.active,curl -s http://localhost/status | grep Active | awk '{print $3}'
UserParameter=nginx.accept,curl -s http://localhost/status | awk NR==3 | awk '{print $1}'
UserParameter=nginx.handle,curl -s http://localhost/status | awk NR==3 | awk '{print $2}'
UserParameter=nginx.request,curl -s http://localhost/status | awk NR==3 | awk '{print $3}'systemctl restart zabbix-agent.service restart zabbix
server5 :
yum install -y zabbix-get.x86_64
zabbix_get -s 172.25.73.2 -p 10050 -k 'nginx.active'
zabbix_get -s 172.25.73.2 -p 10050 -k 'nginx.accept'
zabbix_get -s 172.25.73.2 -p 10050 -k 'nginx.handle'
zabbix_get -s 172.25.73.2 -p 10050 -k 'nginx.request'
stay servre5 On can get To , Then add to zabbix front end
To configure - host -server2- Monitoring direction - Create monitor item
Then create the graph
Do the same with other variables
Click on the graph , Found Chinese garbled , This is because there is no Chinese package in the software , Download one and put it in the corresponding directory
边栏推荐
- 逆袭大学生的职业规划
- Web security - CSRF (token)
- Number of uniform strings of leetcode simple problem
- 2022 P cylinder filling test content and P cylinder filling simulation test questions
- 带有注意力RPN和多关系检测器的小样本目标检测网络(提供源码和数据及下载)...
- Leetcode simple problem delete an element to strictly increment the array
- Market status and development prospects of the global IOT active infrared sensor industry in 2022
- RSRS index timing and large and small disc rotation
- Literature reading_ Research on the usefulness identification of tourism online comments based on semantic fusion of multimodal data (Chinese Literature)
- 2022 new examination questions for the main principals of hazardous chemical business units and examination skills for the main principals of hazardous chemical business units
猜你喜欢
[set theory] relational representation (relational matrix | examples of relational matrix | properties of relational matrix | operations of relational matrix | relational graph | examples of relationa
Contents of welder (primary) examination and welder (primary) examination in 2022
论文阅读_中文NLP_ELECTRA
When using the benchmarksql tool to test the concurrency of kingbasees, there are sub threads that are not closed in time after the main process is killed successfully
Mobile terminal - uniapp development record (public request encapsulation)
The least operation of leetcode simple problem makes the array increment
4 years of experience to interview test development, 10 minutes to end, ask too
STM32 reverse entry
Symbol of array element product of leetcode simple problem
Introduction to JVM principle
随机推荐
Market status and development prospect prediction of global SoC Test Platform Industry in 2022
Use Sqlalchemy module to obtain the table name and field name of the existing table in the database
论文阅读_ICD编码_MSMN
论文阅读_清华ERNIE
MPM model and ab pressure test
JVM原理简介
[SQL injection point] location and judgment of the injection point
Small sample target detection network with attention RPN and multi relationship detector (provide source code, data and download)
Summary of training competition (Lao Li's collection of questions)
Kubernetes source code analysis (I)
UiPath实战(08) - 选取器(Selector)
2022 Shandong Province safety officer C certificate examination content and Shandong Province safety officer C certificate examination questions and analysis
有道云笔记
Thesis reading_ Chinese medical model_ eHealth
普通本科大学生活避坑指南
I stepped on a foundation pit today
The reason why the entity class in the database is changed into hump naming
Employee attendance management system based on SSM
Web security - CSRF (token)
When using the benchmarksql tool to preheat data for kingbasees, execute: select sys_ Prewarm ('ndx_oorder_2 ') error