配置完成 zabbix 后,登录浏览器查看,出现以下错误!
server is not running:the information displayed may not be current
点击 Administration>>Queue 时,也出现了错误。
Connection to Zabbix server "10.18.192.147" refused. Possible reasons:
1. Incorrect server IP/DNS in the "zabbix.conf.php";
2. Security environment (for example, SELinux) is blocking the connection;
3. Zabbix server daemon not running;
4. Firewall is blocking TCP connection.
Connection refused
如图:
按提示,查看配置,正确的:
[root@localhost zabbix]# find / -name zabbix.conf.php
/var/www/html/zabbix/conf/zabbix.conf.php
再查看日志:
[root@localhost zabbix]# tail -n 30 /tmp/zabbix_server.log
11970:20160704:103617.243 Ez Texting notifications: YES
11970:20160704:103617.243 ODBC: NO
11970:20160704:103617.244 SSH2 support: NO
11970:20160704:103617.244 IPv6 support: NO
11970:20160704:103617.244 ******************************
11970:20160704:103617.244 using configuration file: /usr/local/zabbix/etc/zabbix_server.conf
[root@localhost zabbix]#
[root@localhost zabbix]#
[root@localhost zabbix]# tail -n 10 /tmp/zabbix_agentd.log
11887:20160704:103551.877 Zabbix Agent stopped. Zabbix 2.4.8 (revision 59539).
11944:20160704:103601.996 Starting Zabbix Agent [Zabbix server]. Zabbix 2.4.8 (revision 59539).
11944:20160704:103601.996 using configuration file: /usr/local/zabbix/etc/zabbix_agentd.conf
发现启动的配置文件为:
/usr/local/zabbix/etc/zabbix_agentd.conf
/usr/local/zabbix/etc/zabbix_server.conf
而本人之前配置的操作和配置如下:
mkdir /etc/zabbix
cp -r /home/zdtest/zabbix-2.4.8/conf/* /etc/zabbix/
vi /etc/zabbix/zabbix_server.conf
vi /etc/zabbix/zabbix_agentd.conf
vi /etc/zabbix/zabbix_agent.conf
在启动服务时,并不是自己拷贝的配置文件,使用的是系统的配置文件,系统的配置文件还是默认的。
所以解决方法是:
#删除原来自己复制的文件
rm -fr /etc/zabbix
#编辑默认的配置文件:
#vi /usr/local/zabbix/etc/zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
DBPort=3306
#vi /usr/local/zabbix/etc/zabbix_agentd.conf
Server=127.0.0.1,10.18.192.147
ServerActive=127.0.0.1,10.18.192.147:10051
Hostname=Zabbix_server
UnsafeUserParameters=1
#vi /usr/local/zabbix/etc/zabbix_agent.conf
Server=127.0.0.1,10.18.192.147
UnsafeUserParameters=1