zabbix_agentd断断续续端无法访问问题记录
问题现象:
zabbix监控上出现zabbix_agentd无法访问,但是实际上zabbix_agentd是存活状态
每隔一段时间就会出现这样的情况
问题原因
zabbix_agentd端任务较多,活动线程被占满,无法及时响应server端的确认存活信息,导致server端认为agent端未启动
解决方法
在配置文件中修改zabbix_agentd端的活动线程数(默认是3),增加如下配置:
StartAgents=30
~]# vim /usr/local/zabbix_agent/etc/zabbix_agentd.conf
PidFile=/usr/local/zabbix_agent/pids/zabbix_agentd.pid
LogFile=/usr/local/zabbix_agent/logs/zabbix_agentd.log
LogFileSize=1
DebugLevel=3
Timeout=30
StartAgents=20
结果
默认未修改前,线程数如下,只有三条
~]# ps -ef|grep zabbix
zabbix 1404 1 0 Aug26 ? 00:00:00 /usr/local/zabbix_agent/sbin/zabbix_agentd
zabbix 1406 1404 0 Aug26 ? 00:08:43 /usr/local/zabbix_agent/sbin/zabbix_agentd: collector [idle 1 sec]
zabbix 1407 1404 0 Aug26 ? 00:25:04 /usr/local/zabbix_agent/sbin/zabbix_agentd: listener #1 [processing request]
zabbix 1408 1404 0 Aug26 ? 00:24:07 /usr/local/zabbix_agent/sbin/zabbix_agentd: listener #2 [waiting for connection]
zabbix 1409 1404 0 Aug26 ? 00:24:33 /usr/local/zabbix_agent/sbin/zabbix_agentd: listener #3 [processing request]
zabbix 1410 1404 0 Aug26 ? 00:01:56 /usr/local/zabbix_agent/sbin/zabbix_agentd: active checks #1 [idle 1 sec]
修改后,线程变成了
~]# ps -ef|grep zabbix
zabbix 117198 1 0 17:38 ? 00:00:00 /usr/local/zabbix_agent/sbin/zabbix_agentd
zabbix 117200 117198 0 17:38 ? 00:00:00 /usr/local/zabbix_agent/sbin/zabbix_agentd: collector [idle 1 sec]
zabbix 117201 117198 0 17:38 ? 00:00:00 /usr/local/zabbix_agent/sbin/zabbix_agentd: listener #1 [waiting for connection]
zabbix 117202 117198 0 17:38 ? 00:00:00 /usr/local/zabbix_agent/sbin/zabbix_agentd: listener #2 [waiting for connection]
zabbix 117203 117198 0 17:38 ? 00:00:00 /usr/local/zabbix_agent/sbin/zabbix_agentd: listener #3 [waiting for connection]
zabbix 117204 117198 0 17:38 ? 00:00:00 /usr/local/zabbix_agent/sbin/zabbix_agentd: listener #4 [waiting for connection]
zabbix 117205 117198 0 17:38 ? 00:00:00 /usr/local/zabbix_agent/sbin/zabbix_agentd: listener #5 [waiting for connection]
zabbix 117206 117198 0 17:38 ? 00:00:00 /usr/local/zabbix_agent/sbin/zabbix_agentd: listener #6 [waiting for connection]
zabbix 117207 117198 0 17:38 ? 00:00:00 /usr/local/zabbix_agent/sbin/zabbix_agentd: listener #7 [waiting for connection]
zabbix 117208 117198 0 17:38 ? 00:00:00 /usr/local/zabbix_agent/sbin/zabbix_agentd: listener #8 [waiting for connection]
zabbix 117209 117198 0 17:38 ? 00:00:00 /usr/local/zabbix_agent/sbin/zabbix_agentd: listener #9 [waiting for connection]
zabbix 117210 117198 0 17:38 ? 00:00:00 /usr/local/zabbix_agent/sbin/zabbix_agentd: listener #10 [waiting for connection]
zabbix 117211 117198 0 17:38 ? 00:00:00 /usr/local/zabbix_agent/sbin/zabbix_agentd: listener #11 [waiting for connection]
zabbix 117212 117198 0 17:38 ? 00:00:00 /usr/local/zabbix_agent/sbin/zabbix_agentd: listener #12 [waiting for connection]
zabbix 117213 117198 0 17:38 ? 00:00:00 /usr/local/zabbix_agent/sbin/zabbix_agentd: listener #13 [waiting for connection]
zabbix 117214 117198 0 17:38 ? 00:00:00 /usr/local/zabbix_agent/sbin/zabbix_agentd: listener #14 [waiting for connection]
zabbix 117215 117198 0 17:38 ? 00:00:00 /usr/local/zabbix_agent/sbin/zabbix_agentd: listener #15 [waiting for connection]
zabbix 117216 117198 0 17:38 ? 00:00:00 /usr/local/zabbix_agent/sbin/zabbix_agentd: listener #16 [waiting for connection]
zabbix 117217 117198 0 17:38 ? 00:00:00 /usr/local/zabbix_agent/sbin/zabbix_agentd: listener #17 [waiting for connection]
zabbix 117218 117198 0 17:38 ? 00:00:00 /usr/local/zabbix_agent/sbin/zabbix_agentd: listener #18 [waiting for connection]
zabbix 117219 117198 0 17:38 ? 00:00:00 /usr/local/zabbix_agent/sbin/zabbix_agentd: listener #19 [waiting for connection]
zabbix 117220 117198 0 17:38 ? 00:00:00 /usr/local/zabbix_agent/sbin/zabbix_agentd: listener #20 [waiting for connection]
zabbix 117221 117198 0 17:38 ? 00:00:00 /usr/local/zabbix_agent/sbin/zabbix_agentd: active checks #1 [idle 1 sec]
root 117223 112890 0 17:39 pts/0 00:00:00 grep --color=auto zabbix
根据实际生产环境对活动线程数进行调整就好