当前位置:网站首页>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 】
边栏推荐
- Data double write consistency between redis and MySQL
- What is industrial computer encryption and how to do it
- ABCD four sequential execution methods, extended application
- selenium驱动IE常见问题解决Message: Currently focused window has been closed.
- MySQL relearn 2- Alibaba cloud server CentOS installation mysql8.0
- Label management of kubernetes cluster
- SQL foundation 9 [grouping data]
- 【FPGA教程案例8】基于verilog的分频器设计与实现
- Redis - detailed explanation of cache avalanche, cache penetration and cache breakdown
- Tar source code analysis 8
猜你喜欢
[web security] nodejs prototype chain pollution analysis
电脑通过Putty远程连接树莓派
Cervical vertebra, beriberi
Boosting the Performance of Video Compression Artifact Reduction with Reference Frame Proposals and
《剑指Offer》第2版——力扣刷题
校园网络问题
BasicVSR++: Improving Video Super-Resolutionwith Enhanced Propagation and Alignment
The important role of host reinforcement concept in medical industry
响应式移动Web测试题
Centos8 install mysql 7 unable to start up
随机推荐
MySQL 45 lecture learning notes (x) force index
What is the use of cloud redis? How to use cloud redis?
2022年6月小结
Two years ago, the United States was reluctant to sell chips, but now there are mountains of chips begging China for help
tornado项目之路由装饰器
[web security] nodejs prototype chain pollution analysis
ABCD four sequential execution methods, extended application
Experience installing VMware esxi 6.7 under VMware Workstation 16
[Mori city] random talk on GIS data (I)
Status of the thread
Boast about Devops
Introduction to rce in attack and defense world
用于压缩视频感知增强的多目标网络自适应时空融合
uniapp小程序分包
the input device is not a TTY. If you are using mintty, try prefixing the command with ‘winpty‘
There is no Chinese prompt below when inputting text in win10 Microsoft Pinyin input method
flask-sqlalchemy 循环引用
MySQL 45 lecture learning notes (XIII) delete half of the table data, and the table file size remains the same
The number of patent applications in China has again surpassed that of the United States and Japan, ranking first in the world for 11 consecutive years
Check and display one column in the known table column