Environment:
System: CentOS 7.4
Platform: Zabbix 3.2
Installation package: Zabbix-3.2.11.tar
Compile installation path:/usr/local/zabbix_agentd/
Active mode, Passive mode introduction
If you need to refer to this article for configuration, please read through the first and then operate
1, for security purposes, create Zabbix user run
shell> groupadd zabbix shell> useradd -g zabbix zabbix
2. Upload Zabbix installation package
shell>mkdir /usr/local/zabbix_agentd shell> xftp上传安装包
3. Compile and install Agentd
shell>tar -xf /usr/local/zabbix_agentd/zabbix-3.2.11.tar.gzshell>cd /usr/local/zabbix_agentd/zabbix-3.2.11shell>./configure --prefix=/usr/local/zabbix_agentd --enable-agent
shell>make shell>echo $? 0 //表明成功
shell>make installshell>echo $?0 //表明执行成功
4. Configure boot automatically
shell>cp /usr/local/zabbix_agentd/zabbix-3.2.11/misc/init.d/tru64/zabbix_agentd /etc/init.d/ // 复制自动启动文件模版shell>chmod +x /etc/init.d/zabbix_agentd //调整权限
shell>vim /etc/init.d/zabbix_agentd #!/bin/sh 下面添加两行,固定格式,可百度#chkconfig: 345 96 96#description: zabbix server修改DAEMON文件路径,应为指定安装路径的原因所以sbin目录有所改变DAEMON=/usr/local/sbin/zabbix_agentd 修改成DAEMON=/usr/local/zabbix_agentd/sbin/zabbix_agentd
shell>chkconfig --add zabbix_agentd 执行成功说明开机启动已经配置好了shell>chkconfig zabbix_agentd on shell>chkconfig zabbix_agentd --list 检查一下
5. Create Zabbix_agentd log storage folder and set permissions
shell>chown -R zabbix.zabbix /usr/local/zabbix_agentd/ //修改安装目录权限shell>mkdir /var/log/zabbixshell>chown zabbix.zabbix /var/log/zabbix
6, Zabbix agentd active mode and Passive mode introduction 6.1 Active mode
Serveractive is active, the agent requests the server to get a list of active monitoring items and proactively submits the data that needs to be detected in the monitoring item to Server/proxy
(1) Active Mode application scenario
When our Zabbix monitoring platform monitors too many servers and there are too many monitoring items, the following conditions can occur in the management platform:
1, Management page open slow, lag, data load timeout, 502 of the situation
2, the Open process (pollar) too much, even if you reduce the number of item, later to add a certain amount of machine will also have problems
Workaround:
1, increase the proxy node to do distributed monitoring
2. Adjust Agentd to active mode
(2) Working principle
Agent establishes a TCP connection to the server
List of data that the agent requests to be detected
Server Response agent, send an items list
Agent Allow response
TCP connection completes this session shutdown
Agent begins to collect data periodically
(3) Active mode configuration
LogFile=/var/log/zabbix/zabbix_agentd.logStartAgents=0 开启主动模式ServerActive=10.10.10.10Hostname=test
6.2 Passive Mode
The server is in passive mode, and the server requests data from the agent to get the monitored items, and the agent returns the data.
(1) Working principle
Passive mode work Flow:
Server opens a TCP connection
Server sends a key to Agent.ping
The agent accepts this request and then responds to Server docking the data to be processed
TCP connection Shutdown
(2) Configuration method
LogFile=/var/log/zabbix/zabbix_agentd.logServer=10.10.10.10Hostname=test
7. Modify the configuration file
shell>vim /usr/local/zabbix_agentd/etc/zabbix_agentd.conf
1, according to the need to choose active Passive,
2, because the Zabbix monitoring template is used by default is the passive mode, so the zabbix-server side directly add the hosts by default is passive mode.
8. Start ZABBIX_AGENTD Service
shell>/etc/init.d/zabbix_agentd start被动模式验证:shell> netstat -tunlp | grep zabbixtcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 30131/zabbix_agentd 主动模式验证:shell>ps -ef | grep zabbix 表明安装成功
9, if you need to use active mode, and need to use the template version of the
1. Configuration--Templates--template os linux, select Template OS Linux full clone
2. Rename the new clone template to template OS linux_active
3, configuration--template--template OS linux_active--linked template--Cancel template App Zabbix Agent link--Update
4, configuration--template--template OS linux_active--Monitor----Select all Monitoring items--batch update
Monitoring items as active monitoring items
5. Configuration--host--Create host--Link template--Choose template OS linux_active--Add--Update
Note: The hostname is consistent with the configuration file hostname=test
6, the active mode after the completion of the ZBX does not display green lights, detection-the latest data-can be viewed to the data
After adding the finished, it is normal to find the green light is not bright, as long as the monitoring has data on the line.
Linux installation Zabbix Agent (active mode, passive mode)