I installed Zabbix on the virtual machine and installed both the server and the agent side, but failed to
[Email protected] ~]# NETSTAT-NALPTU | grep Zabbix
TCP 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 2176/zabbix_agentd
Monitoring to listen to 10051 ports, the service side is not up, by viewing the Zabbix log zabbix_server.conf (in the directory/tmp/zabbix_server.log) found an error
73415:20181011:184245.845 [Z3001] connection to database ' Zabbix ' failed: [2002] Can ' t connect to local MySQL server Throu GH socket '/var/lib/mysql/mysql.sock ' (2)
Because the/var/lib/mysql/mysql.sock file does not exist,Mysql.sock the correct directory is/tmp/mysql.sock,The Final Solution is:MY.CNF inside the socket path is changed to/tmp/mysql.sock, while Mkdir-p/var/lib/mysql; Touch/var/lib/mysql/mysql.sock,
and made a soft link: ln-s/tmp/mysql.sock/var/lib/mysql/mysql.sock after the normal
Then restart the zabbix_server and zabbix_agentd to properly listen on port 10051
/etc/init.d/zabbix_server restart
/etc/init.d/zabbix_agentd restart
[Email protected] ~]# NETSTAT-NALPTU | grep Zabbix
TCP 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 2588/zabbix_agentd
TCP 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 2499/zabbix_server
Zabbix Unable to monitor the native server