Zabbix server is not running alert on CentOS 6(同时解决SMTP发送失败问题)


In some occasions after installing Zabbix server, the following message gets displayed at the home screen:

Zabbix server is not running: the information displayed may not be current


This issue is related to the Linux Security Module (SELinux) which is a mandatory access control (MAC) security mechanism implemented in the kernel.

To clear the alert, follow the steps outlined below:

- First confirm that SELinux is causing this by running the following command from within Linux console:

tail -f /var/log/audit/audit.log |grep -i avc

- You should see the following lines:

type=AVC msg=audit(1383850274.731:32113): avc:  denied  { name_connect } for  pid=2060 comm=”httpd” dest=10051 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:port_t:s0 tclass=tcp_socket

The best and recommended option to fixing this is to add a policy to allow the connection

- Run the command “getsebool -a“. Locate the following line which should give you a value ‘–> off

httpd_can_network_connect --> off

- Run the command to turn it on

setsebool httpd_can_network_connect on

- Now run the command “getsebool httpd_can_network_connect“. The result should now indicate that the policy is now set to ON

setsebool -P httpd_can_network_connect on

Now the Zabbix alert message should disappear and also the “Zabbix server is running” value should now show ‘Yes


做完以上配置后,重启HTTPD服务后测试,如果仍不可发送SMTP,追加setsebool -P httpd_can_sendmail=1命令,然后重启HTTPD服务后即可。