当前位置:网站首页>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 】
边栏推荐
- kubernetes集群之Label管理
- Two years ago, the United States was reluctant to sell chips, but now there are mountains of chips begging China for help
- Chapter 1 programming problems
- 用于压缩视频感知增强的多目标网络自适应时空融合
- Solution of running crash caused by node error
- Enter the year, month, and determine the number of days
- About how idea sets up shortcut key sets
- NLP-文献阅读总结
- [network data transmission] FPGA based development of 100M / Gigabit UDP packet sending and receiving system, PC to FPGA
- Splicing plain text into JSON strings - easy language method
猜你喜欢
Node connection MySQL access denied for user 'root' @ 'localhost' (using password: yes
Selenium driver ie common problem solving message: currently focused window has been closed
The crackdown on Huawei prompted made in China to join forces to fight back, and another enterprise announced to invest 100 billion in R & D
响应式——媒体查询
win10微软拼音输入法输入文字时候下方不出现中文提示
提升复杂场景三维重建精度 | 基于PaddleSeg分割无人机遥感影像
Boosting the Performance of Video Compression Artifact Reduction with Reference Frame Proposals and
selenium驱动IE常见问题解决Message: Currently focused window has been closed.
Data double write consistency between redis and MySQL
Computer connects raspberry pie remotely through putty
随机推荐
Two years ago, the United States was reluctant to sell chips, but now there are mountains of chips begging China for help
Introduction to deep learning Ann neural network parameter optimization problem (SGD, momentum, adagrad, rmsprop, Adam)
Mobile adaptation: vw/vh
Recursive Fusion and Deformable Spatiotemporal Attention for Video Compression Artifact Reduction
【FreeRTOS】FreeRTOS學習筆記(7)— 手寫FreeRTOS雙向鏈錶/源碼分析
Tar source code analysis Part 10
Blue Bridge Cup Quick sort (code completion)
抽奖系统测试报告
Tar source code analysis Part 7
Responsive - media query
Boosting the Performance of Video Compression Artifact Reduction with Reference Frame Proposals and
MySQL 45 lecture learning notes (XIII) delete half of the table data, and the table file size remains the same
Cervical vertebra, beriberi
The cloud native programming challenge ended, and Alibaba cloud launched the first white paper on application liveliness technology in the field of cloud native
测试用例的设计
A real penetration test
Directory of tornado
云Redis 有什么用? 云redis怎么用?
Transition technology from IPv4 to IPv6
2022-021ARTS:下半年开始