CentOS7 安装 zabbix-2.4.2 web端Missing Database问题

来源:互联网 发布:c#仓库管理系统源码 编辑:程序博客网 时间:2024/05/16 12:05
基础环境:
[root@localhost log]# uname -a
Linux localhost 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

server端的启动已经正常,启动日志如下:

/tmp/zabbix_server.log

  8850:20160114:123146.075 Starting Zabbix Server. Zabbix 2.4.2 (revision 50419).
  8850:20160114:123146.075 ****** Enabled features ******
  8850:20160114:123146.075 SNMP monitoring:            NO
  8850:20160114:123146.075 IPMI monitoring:            NO
  8850:20160114:123146.075 WEB monitoring:            YES
  8850:20160114:123146.075 VMware monitoring:          NO
  8850:20160114:123146.075 Jabber notifications:       NO
  8850:20160114:123146.075 Ez Texting notifications:  YES
  8850:20160114:123146.075 ODBC:                       NO
  8850:20160114:123146.075 SSH2 support:               NO
  8850:20160114:123146.076 IPv6 support:               NO
  8850:20160114:123146.076 ******************************
  8850:20160114:123146.076 using configuration file: /usr/local/zabbix/etc/zabbix_server.conf
  8850:20160114:123146.081 current database version (mandatory/optional): 02040000/02040000
  8850:20160114:123146.081 required mandatory version: 02040000
  8850:20160114:123146.088 server #0 started [main process]
  8856:20160114:123146.089 server #1 started [configuration syncer #1]
  8857:20160114:123146.089 server #2 started [db watchdog #1]
  8858:20160114:123146.089 server #3 started [poller #1]
  8860:20160114:123146.089 server #4 started [poller #2]
  8864:20160114:123146.090 server #6 started [poller #4]
  8862:20160114:123146.090 server #5 started [poller #3]
  8865:20160114:123146.091 server #7 started [poller #5]
  8870:20160114:123146.091 server #9 started [trapper #1]
  8868:20160114:123146.092 server #8 started [unreachable poller #1]
  8871:20160114:123146.092 server #10 started [trapper #2]
  8874:20160114:123146.092 server #11 started [trapper #3]
  8877:20160114:123146.092 server #12 started [trapper #4]
  8878:20160114:123146.093 server #13 started [trapper #5]
  8881:20160114:123146.093 server #14 started [icmp pinger #1]
  8882:20160114:123146.094 server #15 started [alerter #1]
  8884:20160114:123146.094 server #16 started [housekeeper #1]
  8885:20160114:123146.095 server #17 started [timer #1]
  8887:20160114:123146.095 server #18 started [http poller #1]
  8888:20160114:123146.096 server #19 started [discoverer #1]
  8891:20160114:123146.096 server #20 started [history syncer #1]
  8894:20160114:123146.097 server #22 started [history syncer #3]
  8895:20160114:123146.097 server #23 started [history syncer #4]
  8892:20160114:123146.097 server #21 started [history syncer #2]
  8897:20160114:123146.098 server #24 started [escalator #1]
  8900:20160114:123146.098 server #25 started [proxy poller #1]
  8903:20160114:123146.099 server #26 started [self-monitoring #1]
  8877:20160114:123242.948 cannot send list of active checks to [127.0.0.1]: host [Zabbix Server] not monitored
  8877:20160114:123442.967 cannot send list of active checks to [127.0.0.1]: host [Zabbix Server] not monitored
  8877:20160114:123642.986 cannot send list of active checks to [127.0.0.1]: host [Zabbix Server] not monitored
  8877:20160114:123842.005 cannot send list of active checks to [127.0.0.1]: host [Zabbix Server] not monitored
  8877:20160114:124042.022 cannot send list of active checks to [127.0.0.1]: host [Zabbix Server] not monitored
  8871:20160114:124242.040 cannot send list of active checks to [127.0.0.1]: host [Zabbix Server] not monitored

端口也已经运行:
[root@localhost ~]# netstat -antlp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      1593/mysqld         
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      929/sshd            
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1995/master         
tcp        0      0 192.168.214.160:25      0.0.0.0:*               LISTEN      1995/master         
tcp        0      0 0.0.0.0:10050           0.0.0.0:*               LISTEN      1130/zabbix_agentd  
tcp        0      0 0.0.0.0:10051           0.0.0.0:*               LISTEN      8850/zabbix_server  
tcp        0      0 127.0.0.1:10051         127.0.0.1:50766         TIME_WAIT   -                   
tcp        0     52 192.168.214.160:22      192.168.212.5:50411     ESTABLISHED 8560/sshd: root@pts 
tcp6       0      0 :::80                   :::*                    LISTEN      927/httpd           
tcp6       0      0 :::22                   :::*                    LISTEN      929/sshd            
tcp6       0      0 ::1:25                  :::*                    LISTEN      1995/master         
tcp6       0      0 :::443                  :::*                    LISTEN      927/httpd   

进程也在运行:
[root@localhost ~]# ps -ef|grep zabbix
zabbix    1130     1  0 1月13 ?       00:00:00 /usr/local/zabbix/sbin/zabbix_agentd
zabbix    1136  1130  0 1月13 ?       00:00:09 /usr/local/zabbix/sbin/zabbix_agentd: collector [idle 1 sec]
zabbix    1137  1130  0 1月13 ?       00:00:00 /usr/local/zabbix/sbin/zabbix_agentd: listener #1 [waiting for connection]
zabbix    1138  1130  0 1月13 ?       00:00:00 /usr/local/zabbix/sbin/zabbix_agentd: listener #2 [waiting for connection]
zabbix    1139  1130  0 1月13 ?       00:00:00 /usr/local/zabbix/sbin/zabbix_agentd: listener #3 [waiting for connection]
zabbix    1141  1130  0 1月13 ?       00:00:01 /usr/local/zabbix/sbin/zabbix_agentd: active checks #1 [idle 1 sec]
root      8679  8650  0 12:30 pts/1    00:00:00 tail -f /tmp/zabbix_server.log
.....
......

配置文件也正确的:
[root@localhost log]# cat /usr/local/zabbix/etc/zabbix_server.conf
LogFile=/tmp/zabbix_server.log
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
DBSocket=/var/lib/mysql/mysql.sock
DBPort=3306

zabbix用户也可以访问数据库:
root@localhost ~]# mysql -uzabbix -pzabbix
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 879
Server version: 5.5.44-MariaDB MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| zabbix             |
+--------------------+
2 rows in set (0.00 sec)

MariaDB [(none)]> 


在web端却出现的问题:
条件检测都通过的如下:


第3步出现test数据库时,出现Missing database


原因:没有可选的Mysql数据库类型,缺少php-mysql这个包

解决方法:yum install php-mysql 重启apache



0 0