当前位置:网站首页>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

边栏推荐
- Concurrent operation memory interaction
- MC Layer Target
- How to choose cross-border e-commerce multi merchant system
- Use the benchmarksql tool to perform a data prompt on kingbases. The jdbc driver cannot be found
- 2.14 summary
- Market status and development prospect prediction of the global fire alarm sensor industry in 2022
- 并发操作-内存交互操作
- Market status and development prospect prediction of global colorimetric cup cover industry in 2022
- 有道云笔记
- 论文阅读_中文NLP_ELECTRA
猜你喜欢

2022 tea master (intermediate) examination questions and tea master (intermediate) examination skills

Leetcode simple problem delete an element to strictly increment the array

移动端——uniapp开发记录(公共请求request封装)

Human resource management system based on JSP

Pyqt control part (II)

I've been in software testing for 8 years and worked as a test leader for 3 years. I can also be a programmer if I'm not a professional

Thesis reading_ Chinese NLP_ ELECTRA

带有注意力RPN和多关系检测器的小样本目标检测网络(提供源码和数据及下载)...

Use Sqlalchemy module to obtain the table name and field name of the existing table in the database

Triangular rasterization
随机推荐
The least operation of leetcode simple problem makes the array increment
[set theory] binary relationship (special relationship type | empty relationship | identity relationship | global relationship | divisive relationship | size relationship)
Current market situation and development prospect forecast of global UV sensitive resin 3D printer industry in 2022
2022 a special equipment related management (elevator) analysis and a special equipment related management (elevator) simulation test
Mobile terminal - uniapp development record (public request encapsulation)
Introduction to message queuing (MQ)
When using the benchmarksql tool to preheat data for kingbasees, execute: select sys_ Prewarm ('ndx_oorder_2 ') error
I've seen a piece of code in the past. I don't know what I'm doing. I can review it when I have time
Shell script -- condition judgment
2022 P cylinder filling test content and P cylinder filling simulation test questions
STM32 reverse entry
General undergraduate college life pit avoidance Guide
Matplotlib -- save graph
Summary of training competition (Lao Li's collection of questions)
Caijing 365 stock internal reference: what's the mystery behind the good father-in-law paying back 50 million?
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
document. The problem of missing parameters of referer is solved
Number of 1 in binary (simple difficulty)
Employee attendance management system based on SSM
data2vec! New milestone of unified mode