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



边栏推荐
- 同一个job有两个source就报其中一个数据库找不到,有大佬回答下吗
- MySQL 45 lecture learning notes (12) MySQL will "shake" for a while
- Vulhub vulnerability recurrence 76_ XXL-JOB
- 大厂技术专家:架构设计中常用的思维模型
- [Valentine's day] - you can change your love and write down your lover's name
- 【FreeRTOS】FreeRTOS學習筆記(7)— 手寫FreeRTOS雙向鏈錶/源碼分析
- Boosting the Performance of Video Compression Artifact Reduction with Reference Frame Proposals and
- How to input single quotation marks and double quotation marks in latex?
- Two years ago, the United States was reluctant to sell chips, but now there are mountains of chips begging China for help
- the input device is not a TTY. If you are using mintty, try prefixing the command with ‘winpty‘
猜你喜欢

MySQL 45 lecture learning notes (VII) line lock

the input device is not a TTY. If you are using mintty, try prefixing the command with ‘winpty‘

The important role of host reinforcement concept in medical industry
![[Valentine's day] - you can change your love and write down your lover's name](/img/ab/402872ad39f9dc58fd27dd6fc823ef.jpg)
[Valentine's day] - you can change your love and write down your lover's name

移动适配:vw/vh
![[Flink] temporal semantics and watermark](/img/4d/cf9c7e80ea416155cee62cdec8a5bb.jpg)
[Flink] temporal semantics and watermark

Status of the thread

Technical experts from large factories: common thinking models in architecture design

About how idea sets up shortcut key sets

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
随机推荐
输入年份、月份,确定天数
Deep understanding of redis -- a new type of bitmap / hyperloglgo / Geo
【FreeRTOS】FreeRTOS学习笔记(7)— 手写FreeRTOS双向链表/源码分析
移动适配:vw/vh
Literature collation and thesis reading methods
MySQL 45 lecture learning notes (x) force index
JS common time processing functions
Set JTAG fuc invalid to normal IO port
[FreeRTOS] FreeRTOS learning notes (7) - handwritten FreeRTOS two-way linked list / source code analysis
A real penetration test
Finishing (III) - Exercise 2
The cloud native programming challenge ended, and Alibaba cloud launched the first white paper on application liveliness technology in the field of cloud native
Technical experts from large factories: common thinking models in architecture design
[thread pool]
Campus network problems
提升复杂场景三维重建精度 | 基于PaddleSeg分割无人机遥感影像
Download address of the official website of national economic industry classification gb/t 4754-2017
Zabbix agent主动模式的实现
Chapter 1 programming problems
Research on an endogenous data security interaction protocol oriented to dual platform and dual chain architecture