当前位置:网站首页>Implementation of ZABBIX agent active mode
Implementation of ZABBIX agent active mode
2022-07-04 07:13:00 【A rookie who has been studying hard】
Zabbix agent Implementation of active mode
Active mode consists of zabbix agent Active direction zabbix server Of 10051 Port initiation TCP Connection request . Therefore, active mode must be in zabbix agent Specified in the configuration file zabbix server Of IP Or host name ( Must be able to be resolved to IP Address ), Connecting to zabbix server Before ,zabbix agent I don't know what data I want to collect and how often I collect data , And then connect to zabbix server Get it later zabbix agent Monitoring items and data collection intervals , Then collect data according to the monitoring items and return it to zabbix server. In active mode... Is no longer required zabbix server towards zabbix agent Initiate connection request , therefore , Active mode can alleviate zabbix server Number of open local random ports and processes , To some extent, it can alleviate zabbix server Load pressure .
Environmental preparation
Four machines :
zabbix_agent 5.0 Passive mode ( already installed ) Zabbix_java_gateway 5.0 ( already installed ) 10.0.0.7
zabbix_server 5.0( already installed ) 10.0.0.17
Tomcat-8.5( already installed ) 10.0.0.27
zabbix_agent 5.0 Active mode 10.0.0.37
Close the firewall and selinux
# close selinux
[[email protected] ~]#sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
# Turn off firewall
[[email protected] ~]#systemctl disable --now firewalld
# Restart and take effect
[[email protected] ~]#reboot
1. install zabbix rpm Source
[[email protected] ~]#rpm -Uvh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
[[email protected] ~]#sed -i 's#http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix#' /etc/yum.repos.d/zabbix.repo
[[email protected] ~]#yum clean all
2. install zabbix agent
[[email protected] ~]#yum install -y zabbix-agent
# Edit profile /etc/yum.repos.d/zabbix.repo
[[email protected] ~]#vim /etc/yum.repos.d/zabbix.repo
[zabbix-frontend]
...
enabled=1
...
3. modify zabbix agent The configuration file
[[email protected] ~]#vim /etc/zabbix/zabbix_agentd.conf
Server=10.0.0.17
ListenPort=10050
ListenIP=0.0.0.0
StartAgents=5
ServerActive=10.0.0.17 # Active mode zabbix server Address
Hostname=10.0.0.37
Timeout=30
[[email protected] ~]#grep "^[a-Z]" /etc/zabbix/zabbix_agentd.conf
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=10.0.0.17
ListenPort=10050
ListenIP=0.0.0.0
StartAgents=5
ServerActive=10.0.0.17
Hostname=10.0.0.37
Timeout=30
Include=/etc/zabbix/zabbix_agentd.d/*.conf
4. start-up Zabbix agent process
# start-up Zabbix agent process , And set the power on self start
[[email protected] ~]#systemctl restart zabbix-agent.service
[[email protected] ~]#systemctl enable zabbix-agent.service
[[email protected] ~]#systemctl status zabbix-agent.service
● zabbix-agent.service - Zabbix Agent
Loaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2022-07-02 19:12:04 CST; 18s ago
Main PID: 1755 (zabbix_agentd)
CGroup: /system.slice/zabbix-agent.service
├─1755 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
├─1756 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
├─1757 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
├─1758 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
├─1759 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
├─1760 /usr/sbin/zabbix_agentd: listener #4 [waiting for connection]
├─1761 /usr/sbin/zabbix_agentd: listener #5 [waiting for connection]
└─1762 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]
Jul 02 19:12:04 centos7 systemd[1]: Starting Zabbix Agent...
Jul 02 19:12:04 centos7 systemd[1]: Started Zabbix Agent.
# verification Zabbix agent Whether the process exists
[[email protected] ~]#ss -ntlp
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 *:10050 *:*users:(("zabbix_agentd",pid=1762,fd=4),("zabbix_agentd",pid=1761,fd=4),("zabbix_agentd",pid=1760,fd=4),("zabbix_agentd",pid=1759,fd=4),("zabbix_agentd",pid=1758,fd=4),("zabbix_agentd",pid=1757,fd=4),("zabbix_agentd",pid=1756,fd=4),("zabbix_agentd",pid=1755,fd=4))
LISTEN 0 128 *:22 *:*users:(("sshd",pid=1298,fd=3))
LISTEN 0 100 127.0.0.1:25 *:*users:(("master",pid=1461,fd=13))
LISTEN 0 128 [::]:22 [::]:*users:(("sshd",pid=1298,fd=4))
LISTEN 0 100 [::1]:25 [::]:*users:(("master",pid=1461,fd=14))
[[email protected] ~]#ps -ef | grep zabbix_agentd
zabbix 1755 1 0 19:12 ? 00:00:00 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
zabbix 1756 1755 0 19:12 ? 00:00:00 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
zabbix 1757 1755 0 19:12 ? 00:00:00 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
zabbix 1758 1755 0 19:12 ? 00:00:00 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
zabbix 1759 1755 0 19:12 ? 00:00:00 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
zabbix 1760 1755 0 19:12 ? 00:00:00 /usr/sbin/zabbix_agentd: listener #4 [waiting for connection]
zabbix 1761 1755 0 19:12 ? 00:00:00 /usr/sbin/zabbix_agentd: listener #5 [waiting for connection]
zabbix 1762 1755 0 19:12 ? 00:00:00 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]
root 1788 1565 0 19:14 pts/0 00:00:00 grep --color=auto zabbix_agentd
5. Generate active mode template
Click on 【 To configure - host -10.0.0.7-web1- clone 】


6. Verify active mode host status
#【ZBX】 green , Indicates that the host is available , Monitoring indicator check succeeded

7. Verify the active mode host port
[[email protected]_server ~]#netstat -tanlp | grep 10.0.0.37
tcp 0 0 10.0.0.17:10051 10.0.0.37:43072 TIME_WAIT -
tcp 0 0 10.0.0.17:10051 10.0.0.37:43062 TIME_WAIT -
tcp 0 0 10.0.0.17:10051 10.0.0.37:43070 TIME_WAIT -
tcp 0 0 10.0.0.17:10051 10.0.0.37:43068 TIME_WAIT -
tcp 0 0 10.0.0.17:10051 10.0.0.37:43066 TIME_WAIT -
tcp 0 0 10.0.0.17:10051 10.0.0.37:43064 TIME_WAIT -
8. Verify active mode host data

9. hold 【 Auto discovery rules 】 The time interval of is changed to 60s
Click on 【 To configure - host -10.0.0.37-web2- Auto discovery rules 】



边栏推荐
- 【FPGA教程案例7】基于verilog的计数器设计与实现
- Su Weijie, a member of Qingyuan Association and an assistant professor at the University of Pennsylvania, won the first Siam Youth Award for data science, focusing on privacy data protection, etc
- How to buy financial products in 2022?
- Responsive - media query
- If there are two sources in the same job, it will be reported that one of the databases cannot be found. Is there a boss to answer
- [network data transmission] FPGA based development of 100M / Gigabit UDP packet sending and receiving system, PC to FPGA
- Research on an endogenous data security interaction protocol oriented to dual platform and dual chain architecture
- [untitled] notice on holding "2022 traditional fermented food and modern brewing technology"
- 【FreeRTOS】FreeRTOS学习笔记(7)— 手写FreeRTOS双向链表/源码分析
- BasicVSR++: Improving Video Super-Resolutionwith Enhanced Propagation and Alignment
猜你喜欢

【Kubernetes系列】Kubernetes 上安装 KubeSphere

Su Weijie, a member of Qingyuan Association and an assistant professor at the University of Pennsylvania, won the first Siam Youth Award for data science, focusing on privacy data protection, etc

The cloud native programming challenge ended, and Alibaba cloud launched the first white paper on application liveliness technology in the field of cloud native

Chain ide -- the infrastructure of the metauniverse

tornado项目之路由装饰器

notepad++如何统计单词数量

Introduction to deep learning Ann neural network parameter optimization problem (SGD, momentum, adagrad, rmsprop, Adam)

大厂技术专家:架构设计中常用的思维模型

selenium IDE插件下载安装使用教程

Recursive Fusion and Deformable Spatiotemporal Attention for Video Compression Artifact Reduction
随机推荐
在已經知道錶格列勾選一個顯示一列
"Sword finger offer" 2nd Edition - force button brush question
MySQL 45 lecture learning notes (x) force index
Vulhub vulnerability recurrence 77_ zabbix
[freertos] freertos Learning notes (7) - written freertos bidirectionnel Link LIST / source analysis
由于dms升级为了新版,我之前的sql在老版本的dms中,这种情况下,如何找回我之前的sql呢?
JS common time processing functions
NLP literature reading summary
2022年6月小结
【森城市】GIS数据漫谈(一)
tornado之目录
The most effective futures trend strategy: futures reverse merchandising
A real penetration test
Paddleocr prompt error: can not import AVX core while this file exists: xxx\paddle\fluid\core_ avx
Boosting the Performance of Video Compression Artifact Reduction with Reference Frame Proposals and
The cloud native programming challenge ended, and Alibaba cloud launched the first white paper on application liveliness technology in the field of cloud native
Design of test cases
BasicVSR++: Improving Video Super-Resolutionwith Enhanced Propagation and Alignment
高薪程序员&面试题精讲系列119之Redis如何实现分布式锁?
[network data transmission] FPGA based development of 100M / Gigabit UDP packet sending and receiving system, PC to FPGA