当前位置:网站首页>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
边栏推荐
- JVM原理简介
- The programmer went to bed at 12 o'clock in the middle of the night, and the leader angrily scolded: go to bed so early, you are very good at keeping fit
- LVS load balancing cluster of efficient multi-purpose cluster (NAT mode)
- FuncS sh file not found when using the benchmarksql tool to test kingbases
- MySQL winter vacation self-study 2022 12 (3)
- FISCO bcos zero knowledge proof Fiat Shamir instance source code
- Function introduction of member points mall system
- Thesis reading_ Chinese medical model_ eHealth
- Literature reading_ Research on the usefulness identification of tourism online comments based on semantic fusion of multimodal data (Chinese Literature)
- Number of uniform strings of leetcode simple problem
猜你喜欢
Jincang KFS data bidirectional synchronization scenario deployment
Golang -- realize file transfer
Contents of welder (primary) examination and welder (primary) examination in 2022
Truncated sentences of leetcode simple questions
【工具跑SQL盲注】
"Niuke brush Verilog" part II Verilog advanced challenge
Thesis reading_ Chinese NLP_ ELECTRA
Learning practice: comprehensive application of cycle and branch structure (I)
Php+mysql registration landing page development complete code
Preparation for school and professional cognition
随机推荐
Mount NFS in kubesphere
AWS VPC
Concurrent operation memory interaction
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] binary relation (example of binary relation on a | binary relation on a)
2022 registration examination for safety production management personnel of hazardous chemical production units and examination skills for safety production management personnel of hazardous chemical
MySQL winter vacation self-study 2022 12 (3)
The least operation of leetcode simple problem makes the array increment
Thesis reading_ Chinese NLP_ ELECTRA
论文阅读_清华ERNIE
"Niuke brush Verilog" part II Verilog advanced challenge
Kubernetes source code analysis (I)
Market status and development prospect prediction of the global forward fluorescent microscope industry in 2022
Leetcode simple problem delete an element to strictly increment the array
雇佣收银员(差分约束)
String matching: find a substring in a string
Market status and development prospect prediction of global SoC Test Platform Industry in 2022
Writing skills of multi plate rotation strategy -- strategy writing learning materials
Learning practice: comprehensive application of cycle and branch structure (I)
Php+mysql registration landing page development complete code