D
D
DVoropaev2017-08-24 12:21:58
linux
DVoropaev, 2017-08-24 12:21:58

Why can't zabbix-agent connect to zabbix server?

Here is the status of the zabbix agent:

sudo systemctl status zabbix-agent
● zabbix-agent.service - Zabbix Agent
   Loaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; enabled; vendor preset: disabled)
   Active: active (running) since Чт 2017-08-24 14:31:18 MSK; 58s ago
  Process: 3339 ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=0/SUCCESS)
  Process: 3356 ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE (code=exited, status=0/SUCCESS)
 Main PID: 3343 (zabbix_agentd)
   CGroup: /system.slice/zabbix-agent.service
           ‣ 3343 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf

авг 24 14:31:18 SRV-P-WEB-003.samelogic.local systemd[1]: Starting Zabbix Agent...
авг 24 14:31:18 SRV-P-WEB-003.samelogic.local systemd[1]: Started Zabbix Agent.

Here are the zabbix agent logs:
3261:20170824:142048.796 Got signal [signal:15(SIGTERM),sender_pid:3290,sender_uid:0,reason:0]. Exiting ...
  3261:20170824:142048.799 Zabbix Agent stopped. Zabbix 3.2.7 (revision 70298).
  3298:20170824:142107.376 Starting Zabbix Agent [SRV]. Zabbix 3.2.7 (revision 70298).
  3298:20170824:142107.377 **** Enabled features ****
  3298:20170824:142107.377 IPv6 support:          YES
  3298:20170824:142107.377 TLS support:           YES
  3298:20170824:142107.377 **************************
  3298:20170824:142107.377 using configuration file: /etc/zabbix/zabbix_agentd.conf
  3298:20170824:142107.377 agent #0 started [main process]
  3300:20170824:142107.379 agent #2 started [listener #1]
  3301:20170824:142107.380 agent #3 started [listener #2]
  3302:20170824:142107.382 agent #4 started [listener #3]
  3303:20170824:142107.383 agent #5 started [active checks #1]
  3299:20170824:142107.385 agent #1 started [collector]
  3303:20170824:142107.385 active check configuration update from [***.**.***.**:10051] started to fail (cannot connect to [[***.**.***.**]:10051]: [113] No route to host)
zabbix_agentd [3317]: Is this process already running? Could not lock PID file [/var/run/zabbix/zabbix_agentd.pid]: [11] Resource temporarily unavailable

and here is its config:
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
EnableRemoteCommands=1
Server=***.**.***.**
ServerActive=***.**.***.**
Hostname=SRV
Include=/etc/zabbix/zabbix_agentd.d/*.conf

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
P
Puma Thailand, 2017-08-24
@opium

Yes, you have written that he cannot lock a pid

K
ky0, 2017-08-24
@ky0

Telnet passes? Round trip? If not (especially if from the server to the client) - this is the reason, dig firewalls, etc.

A
Anton Bulkin, 2021-02-25
@wulxgarnyj

Since there is no answer in this question, and yesterday I spent several hours solving this problem, I will answer, perhaps, who will come here by googling. Not everyone often works with UNIX systems, this is not obvious to everyone, and manuals do not write explicitly.
If you are setting up a server with a proxy and an agent behind the proxy according to the manuals, and the host does not appear on your server, check the order of the rules in the INPUT chain in iptables. The port permission rules must be higher than the DROP and REJECT rules, otherwise the agent will write "No route to host".
These rules must be written on both the server and the proxy.

R
Rsa97, 2017-08-24
@Rsa97

No route to host - routing problems. The agent computer did not find a network path to the server computer.

M
Michael, 2017-08-24
@ARMADIK

PS Run tshark or tcpdump on the port and everything will become clear right away.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question