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

边栏推荐
- [BMZCTF-pwn] 18-RCTF-2017-Recho
- Market status and development prospect prediction of the global forward fluorescent microscope industry in 2022
- Web security - CSRF (token)
- Apache MPM model and ab stress test
- Market status and development prospect prediction of global neutral silicone sealant industry in 2022
- 带有注意力RPN和多关系检测器的小样本目标检测网络(提供源码和数据及下载)...
- Why should programmers learn microservice architecture if they want to enter a large factory?
- 【PHP漏洞-弱类型】基础知识、php弱相等、报错绕过
- Smart contract security audit company selection analysis and audit report resources download - domestic article
- 2.14 summary
猜你喜欢

MPM model and ab pressure test

Golang -- realize file transfer

I stepped on a foundation pit today

MC Layer Target

Contents of welder (primary) examination and welder (primary) examination in 2022

stm32逆向入门

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

Function introduction of member points mall system

MC Layer Target

Thesis reading_ Chinese NLP_ ELECTRA
随机推荐
I stepped on a foundation pit today
[luatos sensor] 1 light sensing bh1750
Market status and development prospect prediction of global fermentation acid industry in 2022
Priv-app permission异常
Leetcode simple question: check whether the array is sorted and rotated
Market status and development prospect prediction of the global fire hose industry in 2022
Leetcode simple problem delete an element to strictly increment the array
并发操作-内存交互操作
Truncated sentences of leetcode simple questions
2022 registration examination for safety production management personnel of hazardous chemical production units and examination skills for safety production management personnel of hazardous chemical
[tools run SQL blind note]
Market status and development prospect prediction of the global fire alarm sensor industry in 2022
消息队列(MQ)介绍
Handling record of electric skateboard detained by traffic police
When using the benchmarksql tool to preheat data for kingbasees, execute: select sys_ Prewarm ('ndx_oorder_2 ') error
First + only! Alibaba cloud's real-time computing version of Flink passed the stability test of big data products of the Institute of ICT
4 years of experience to interview test development, 10 minutes to end, ask too
[set theory] binary relation (example of binary relation on a | binary relation on a)
Market status and development prospect prediction of the global forward fluorescent microscope industry in 2022
Pyqt control part (II)