Zabbix添加主机后ZBX Availability仅为红色的故障解决求助
Alright, let's work through this Zabbix agent connection problem together— that red ZBX Availability status and "cannot connect to [IP]:10050" error is a pretty common headache, but we can nail it down step by step.
1. First, confirm basic network connectivity
Start by ruling out simple network issues from the Zabbix Server side:
- Run this command on your Zabbix Server to test if it can reach the agent's port 10050:
telnet [AGENT_IP] 10050
If telnet isn't installed, use netcat instead:nc -zv [AGENT_IP] 10050
If this fails, the problem is definitely network-related—jump straight to checking firewalls/security groups. - Double-check that the agent's IP in the Zabbix host configuration is correct (no typos, and you've selected the "Agent" interface type, not SNMP or JMX).
2. Check firewalls and cloud security groups
Blocked ports are the #1 culprit here:
On the agent machine:
- Linux: Check if your firewall (firewalld/ufw/iptables) is blocking 10050/tcp. For firewalld, list allowed ports with:
firewall-cmd --list-ports
If 10050/tcp isn't there, add it permanently and reload:firewall-cmd --add-port=10050/tcp --permanent && firewall-cmd --reload - Windows: Open Windows Defender Firewall > Advanced Settings, and make sure there's an inbound rule allowing TCP port 10050 for the Zabbix Agent executable.
Cloud environments (AWS/Azure/GCP):
Verify the security group attached to the agent instance allows inbound traffic on 10050/tcp only from your Zabbix Server's IP (never open it to 0.0.0.0/0 unless absolutely necessary).
3. Make sure the Zabbix Agent is running and healthy
A stopped or misconfigured agent can't accept connections:
- Linux: Check the agent status with:
systemctl status zabbix-agent
If it's inactive, start it and enable auto-start on boot:systemctl start zabbix-agent && systemctl enable zabbix-agent
Check the agent logs for errors (usually at/var/log/zabbix/zabbix_agentd.log)—look for lines like "cannot bind to port" or "invalid configuration parameter". - Windows: Open
services.msc, find the Zabbix Agent service, confirm it's running. If not, start it and set its Startup Type to Automatic. Check the log file (default path:C:\Program Files\Zabbix Agent\zabbix_agentd.log).
4. Validate the Zabbix Agent configuration
Incorrect config settings will block connections from the server:
Open the agent config file (Linux: /etc/zabbix/zabbix_agentd.conf; Windows: C:\Program Files\Zabbix Agent\zabbix_agentd.conf) and double-check these critical parameters:
Server=[ZABBIX_SERVER_IP]: This must be the exact IP of your Zabbix Server (or a comma-separated list if using proxies). The agent only accepts connections from these IPs.Hostname=[HOST_NAME]: This must exactly match the hostname you entered in the Zabbix host configuration (it's case-sensitive!).ServerActive=[ZABBIX_SERVER_IP]:10051: Optional, but if you're using active checks, this needs to point to your server's 10051 port.
After making changes, restart the agent service to apply them.
5. Double-check Zabbix Server host settings
Sometimes the issue is on the web interface side:
- Go to Configuration > Hosts in the Zabbix web UI, edit the problematic host.
- Confirm the "Agent" interface has the correct IP and port (10050).
- Ensure the host is marked as Enabled (not disabled).
- Verify the host is assigned to the correct group, and any attached templates are compatible with your agent version.
6. Advanced troubleshooting steps
If none of the above works, dig deeper:
- Check for network proxies, NAT devices, or VPNs between the server and agent that might be blocking traffic.
- Confirm your Zabbix Server and Agent are running compatible versions (e.g., a 6.4 agent with a 5.0 server can cause connectivity issues—stick to matching or closely related versions).
- Linux only: Check if SELinux is enforcing and blocking the agent. Run
sestatusto see the mode. If enforcing, temporarily set it to permissive for testing:setenforce 0
(Note: Don't leave SELinux disabled permanently—add a proper rule if this fixes the issue.)
If you're still stuck, share the relevant lines from your Zabbix Agent log and Server log, and we can narrow it down further.
内容的提问来源于stack exchange,提问作者Mateusz Chojnowski

