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



边栏推荐
- Vulhub vulnerability recurrence 77_ zabbix
- Since DMS is upgraded to a new version, my previous SQL is in the old version of DMS. In this case, how can I retrieve my previous SQL?
- Directory of tornado
- Latex中的单引号,双引号如何输入?
- Cervical vertebra, beriberi
- MySQL 45 lecture learning notes (VII) line lock
- Pangu open source: multi support and promotion, the wave of chip industry
- Two years ago, the United States was reluctant to sell chips, but now there are mountains of chips begging China for help
- 高薪程序员&面试题精讲系列119之Redis如何实现分布式锁?
- Introduction to rce in attack and defense world
猜你喜欢

NLP-文献阅读总结

How notepad++ counts words

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

MySQL storage engine

电脑通过Putty远程连接树莓派

用于压缩视频感知增强的多目标网络自适应时空融合
![[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
![SQL foundation 9 [grouping data]](/img/8a/a72941d8c3413316b063033a1b5038.jpg)
SQL foundation 9 [grouping data]

Set JTAG fuc invalid to normal IO port

云Redis 有什么用? 云redis怎么用?
随机推荐
用于压缩视频感知增强的多目标网络自适应时空融合
Experience installing VMware esxi 6.7 under VMware Workstation 16
电脑通过Putty远程连接树莓派
Recursive Fusion and Deformable Spatiotemporal Attention for Video Compression Artifact Reduction
【FPGA教程案例8】基于verilog的分频器设计与实现
Responsive - media query
[Mori city] random talk on GIS data (I)
[web security] nodejs prototype chain pollution analysis
[FPGA tutorial case 8] design and implementation of frequency divider based on Verilog
Tar source code analysis 8
Chapter 1 programming problems
Crawler (III) crawling house prices in Tianjin
【森城市】GIS数据漫谈(一)
Why does the producer / consumer mode wait () use while instead of if (clear and understandable)
Selection (023) - what are the three stages of event propagation?
电子协会 C语言 1级 35 、银行利息
【网络数据传输】基于FPGA的百兆网/兆网千UDP数据包收发系统开发,PC到FPGA
jdbc连接es查询的时候,有遇到下面这种情况的大神嘛?
Finishing (III) - Exercise 2
图的底部问题