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

基础环境:
[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
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
你好!要在CentOS 7上安装Zabbix Server 5.0,可以按照以下步骤进行操作: 1. 添加Zabbix存储库: ``` sudo rpm -ivh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm ``` 2. 安装Zabbix Server、Frontend和Agent: ``` sudo yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent ``` 3. 创建Zabbix数据库: ``` sudo mysql -u root -p ``` 在MySQL提示符下,输入以下命令: ``` create database zabbix character set utf8 collate utf8_bin; grant all privileges on zabbix.* to zabbix@localhost identified by 'password'; flush privileges; quit; ``` 4. 导入初始数据库模式和数据: ``` sudo zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | sudo mysql -u zabbix -p zabbix ``` 5. 配置Zabbix Server: 打开Zabbix Server配置文件: ``` sudo nano /etc/zabbix/zabbix_server.conf ``` 修改以下参数(根据数据库设置进行修改): ``` DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=password ``` 6. 启动Zabbix Server和Agent服务,并设置开机自启动: ``` sudo systemctl start zabbix-server zabbix-agent sudo systemctl enable zabbix-server zabbix-agent ``` 7. 配置防火墙允许Zabbix Web访问: ``` sudo firewall-cmd --permanent --add-port=80/tcp sudo firewall-cmd --reload ``` 8. 配置Zabbix Web界面: 将Zabbix Web配置文件复制到Nginx配置目录: ``` sudo cp /usr/share/doc/zabbix-web-mysql-*/nginx.conf /etc/nginx/conf.d/zabbix.conf ``` 打开Zabbix Web配置文件: ``` sudo nano /etc/nginx/conf.d/zabbix.conf ``` 修改以下行(如果已经存在): ``` listen 80; server_name your_domain_or_IP; ``` 保存并关闭文件。 9. 重启Nginx和PHP-FPM服务: ``` sudo systemctl restart nginx php-fpm ``` 现在,你应该能够通过在Web浏览器中输入服务器的IP地址或域名来访问Zabbix Web界面。默认的登录凭据为Admin / zabbix。请确保修改默认密码以增加安全性。 希望这些步骤对你有帮助!如有任何疑问,请随时提问。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值