zabbix 客户端启动端口未监听
启动zabbix客户端后 发现服务正常 但是端口未开启
[root@localhost ~]# systemctl restart zabbix-agent
[root@localhost ~]# systemctl status zabbix-agent
● zabbix-agent.service - Zabbix Agent
Loaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; disabled; vendor preset: disabled)
Active: active (running) since Tue 2019-08-21 17:43:41 CST; 2s ago
Process: 19572 ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=0/SUCCESS)
Process: 19575 ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE (code=exited, status=0/SUCCESS)
Main PID: 19577 (zabbix_agentd)
Tasks: 3
Memory: 1.5M
CGroup: /system.slice/zabbix-agent.service
├─19577 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
├─19578 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
└─19579 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]
Aug 21 17:43:41 iZbp1czpl17je75iurd59hZ systemd[1]: Starting Zabbix Agent…
Aug 21 17:43:41 iZbp1czpl17je75iurd59hZ systemd[1]: PID file /run/zabbix/zabbix_agentd.pid not readable (y…rt.
Aug 20 17:43:41 iZbp1czpl17je75iurd59hZ systemd[1]: Started Zabbix Agent.
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost ~]# ps -ef |grep zabbix
zabbix 19577 1 0 17:43 ? 00:00:00 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
zabbix 19578 19577 0 17:43 ? 00:00:00 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
zabbix 19579 19577 0 17:43 ? 00:00:00 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]
root 19632 17754 0 17:43 pts/2 00:00:00 grep --color=auto zabbix
[root@localhost ~]# ss -antp |grep 10050
查看日志
[root@localhost ~]# cat /var/log/zabbix/zabbix_agentd.log
20937:20190821:175716.334 Got signal [signal:15(SIGTERM),sender_pid:21167,sender_uid:0,reason:0]. Exiting ...
20937:20190821:175716.335 Zabbix Agent stopped. Zabbix 4.0.11 (revision 53bb6bc0f0).
21172:20190821:175716.353 Starting Zabbix Agent [iZbp1czpl17je75iurd59hZ]. Zabbix 4.0.11 (revision 53bb6bc0f0).
21172:20190821:175716.353 **** Enabled features ****
21172:20190821:175716.353 IPv6 support: YES
21172:20190821:175716.353 TLS support: YES
21172:20190821:175716.353 **************************
21172:20190821:175716.353 using configuration file: /etc/zabbix/zabbix_agentd.conf
21172:20190821:175716.353 agent #0 started [main process]
21173:20190821:175716.353 agent #1 started [collector]
21174:20190821:175716.354 agent #2 started [active checks #1]
可以看到客户端启动失败
查看配置文件
原来是使用被动模式,将主动模式的#ServerActive=127.0.0.1禁止了
然后发现 StartAgents选项(在被动模式下,此参数用于设置控制监听进程可启用的子进程的数量)设置为0 禁用了被动模式 导致两个模式都不能用 把0改为3 重新启动 成功
[root@localhost ~]# ss -antp |grep 10050
LISTEN 0 128 :::10050 ::? users:((“zabbix_agentd”,pid=14624,fd=5),(“zabbix_agentd”,pid=14623,fd=5),(“zabbix_agentd”,pid=14622,fd=5),(“zabbix_agentd”,pid=14621,fd=5),(“zabbix_agentd”,pid=14620,fd=5))