安装Zabbix过程中出现的问题集

安装Zabbix过程中出现的问题集:


zabbix是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案。 zabbix能监视各种网络参数,保证服务器系统的安全运营;并提供灵活的通知机制以让系统管理员快速定位/解决存在的各种问题。


故障一:
  2637:20151009:050431.719 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: YES)
  2637:20151009:050431.719 database is down: reconnecting in 10 seconds
权限问题,执行下面的SQL语句.
MariaDB [(none)]>  grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
Query OK, 0 rows affected (0.00 sec)


故障二:
PHP time zone    unknown         Fail

    php_value max_execution_time 300
    php_value memory_limit 128M
    php_value post_max_size 16M
    php_value upload_max_filesize 2M
    php_value max_input_time 300
    php_value date.timezone Asia/Shanghai #修改成正确的时区.
[root@localhost zabbix]# service httpd restart

故障三:
zabbix server is not running the information displayed may not be current
selinux 问题
[root@zabbix create]# getenforce 
Enforcing
[root@zabbix create]# setenforce 0
[root@zabbix create]# getenforce  
Permissive
或者
[root@zabbix create]# vim /etc/selinux/config

type=AVC msg=audit(1444450162.226:7610): avc:  denied  { name_connect } for  pid=31941 comm="httpd" dest=10051 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:zabbix_port_t:s0 tclass=tcp_socket
type=SYSCALL msg=audit(1444450162.226:7610): arch=c000003e syscall=42 success=no exit=-13 a0=c a1=7f95a9345270 a2=10 a3=0 items=0 ppid=31936 pid=31941 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4294967295 comm="httpd" exe="/usr/sbin/httpd" subj=system_u:system_r:httpd_t:s0 key=(null)
type=AVC msg=audit(1444450171.586:7611): avc:  denied  { name_connect } for  pid=32146 comm="httpd" dest=10051 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:zabbix_port_t:s0 tclass=tcp_socket
type=SYSCALL msg=audit(1444450171.586:7611): arch=c000003e syscall=42 success=no exit=-13 a0=b a1=7f95a934dbe0 a2=10 a3=3 items=0 ppid=31936 pid=32146 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4294967295 comm="httpd" exe="/usr/sbin/httpd" subj=system_u:system_r:httpd_t:s0 key=(null)
type=AVC msg=audit(1444450172.228:7612): avc:  denied  { name_connect } for  pid=32146 comm="httpd" dest=10051 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:zabbix_port_t:s0 tclass=tcp_socket
type=SYSCALL msg=audit(1444450172.228:7612): arch=c000003e syscall=42 success=no exit=-13 a0=c a1=7f95a9354a50 a2=10 a3=0 items=0 ppid=31936 pid=32146 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4294967295 comm="httpd" exe="/usr/sbin/httpd" subj=system_u:system_r:httpd_t:s0 key=(null)
type=MAC_STATUS msg=audit(1444450178.657:7613): enforcing=0 old_enforcing=1 auid=0 ses=969




赠送:

http://blog.sina.com.cn/s/blog_8d4a23fe0102vc8q.html


1、web页面无法显示:

原因一:检查系统是否安装apache,以便解析html

原因二php没有完全安装好

原因三apache没有提供对php的支持

原因四apache的配置文件中DocumentRoot的参数值没有改成zabbix的路径,zabbix默认的路径    /var/www/html/

 

解决方案一:安装apache

tar zxvf httpd-2.2.23.tar.gz

cd httpd-2.2.23

./configure --prefix=/usr/local/apache

make && make install

安装过程中出现错误, 则在编译时入加 --with-included-apr 参数

 

解决方案二:完整安装php

安装php时首先要检查系统是否安装了支持zabbix的依赖包,特别GD库的安装,如果gd库没安装会 导致zabbix安装过程出现问题。

 

<1>安装freetypelibpngjpeg以便于让php支持GD库(WeatherMap插件必须要较新的GD库支持)

tar -zxvf libpng-1.2.18.tar.gz

./configure --prefix=/usr/local/libpng

make && make install

 

tar -zxvf freetype-2.3.5.tar.gz

./configure --prefix=/usr/local/freetype

mak&&make install

 

tar -zxvf jpegsrc.v7.tar.gz

mkdir /usr/local/libjpeg

mkdir /usr/local/libjpeg/bin

mkdir /usr/local/libjpeg/lib

mkdir /usr/local/libjpeg/man

mkdir /usr/local/libjpeg/man/man1

./configure --prefix=/usr/local/libjpeg/ --enable-shared --enable-static

make && make install

 

tar -zxvf gd-2.0.28.tar.gz

./configure --prefix=/usr/local/libgd --with-png --with-freetype=/usr/local/freetype/ --with- jpeg=/usr/local/libjpeg/ 

make && make install

 

安装完成后,gd进行配置:

 

vi /etc/ld.so.conf

/usr/local/freetype/lib

/usr/local/libjpeg/lib

/usr/local/libgd/lib

ldconfig   --------执行命令,使用动态装入器装载找到的共享库

 

<2>安装PHP

 

cd php-5.6.0

  ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with- mysql=/usr/local/mysql/ --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-bcmath --enable- mbstring --enable-sockets --with-gd --with- gettext --with-freetype-dir=/usr/local/freetype/ --with-jpeg- dir=/usr/local/libjpeg/ 

make clean 

make && make install

安装完后将tar包中的php.ini-developmentphp.ini-production复制到到/usr/local/php/lib下,并更名为php.ini

 

 

-with-apxs2=/usr/local/apache/bin/apxs 

支持apache

--with-mysql=/usr/local/mysql/ 

支持mysql

--with-mysqli=/usr/local/mysql/bin/mysql_config

优化支持mysqli

--enable-bcmath 

打开图片大小调整

--enable-mbstring 

多字节,字符串的支持

--enable-sockets 

打开sockets 支持

--with-gd 

打开gd库的支持

--with-gettext 

打开gnugettext 支持,编码库用到

--with-freetype-dir=/usr/local/freetype/

打开对freetype字体库的支持

--with-jpeg-dir=/usr/local/libjpeg/ 

打开对jpeg图片的支持

 

解决方案三:apache没有提供对php的支持

打开apache的配置文档/usr/local/apache/conf/httpd.conf,修改其中参数

模块中修改为

  DirectoryIndex index.html index.php

 

模块中添加

AddType application/x-httpd-php .php .php3 .php4

修改完成后需重新启动apache

 

2、访问目录http://ip/zabbix会显示:

Forbidden  

You don't have permission to access /test/ on this server.

 

解决方案:

apache的配置文档中找到,其中定义了Deny from all,可以将其注释,就不会封网段

 

3、zabbix在安装过程中出现无法找到sock文件的问题

解决方案:

mysqlsocket.sock文件软链接到zabbix的路径

 

4、登录进zabbix页面中,页面显示如下错误:

ini_set(): Use of mbstring.internal_encoding is deprecated [dashboard.php:21 → require_once() → 

ZBase->run() → ZBase>initLocales() → init_mbstrings() 

 ini_set() in /var/www/html/zabbix/include/locales.inc.php:25]

 

解决方案:

将路径中/var/www/html/zabbix/include/locales.inc.php的第25行数据注释掉,页面不会显示错误

 

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在Docker安装Zabbix,首先需要执行两个命令来生成Zabbix Server和Zabbix Web容器。执行以下命令生成Zabbix Server容器: ``` docker run --name zabbix-server-mysql-8 -t \ --net=zabbix_app_net \ --env-file /root/docker_env_file/zabbix_server_8.list \ -v /root/zabbix_etc_file/alertscripts:/usr/lib/zabbix/alertscripts \ -p 10051 \ -d zabbix/zabbix-server-mysql:centos-4.0.3 ``` \[1\] 然后,执行以下命令生成Zabbix Web容器: ``` docker run --name zabbix-web-nginx-mysql-8 \ --net=zabbix_app_net \ -p80 \ --env-file /root/docker_env_file/zabbix_web_8.list \ -d zabbix/zabbix-web-nginx-mysql:centos-4.0.3 ``` \[2\] 这样就在Docker成功安装ZabbixZabbix是一个基于WEB界面的开源解决方案,提供分布式系统监视和网络监视功能。它能监视各种网络参数,保证服务器系统的安全运营,并提供灵活的通知机制以便系统管理员快速定位和解决问题Zabbix由两部分组成,服务端Zabbix Server和可选组件客户端Zabbix Agent。安装Zabbix之前,需要准备好VMware Workstation Pro和CentOS 7的环境,并安装好Docker容器。然后,通过在Docker镜像下安装Zabbix的步骤,可以完成Zabbix安装和配置。\[3\] #### 引用[.reference_title] - *1* *2* [ZABBIX(docker版)安装](https://blog.csdn.net/topswim/article/details/87877454)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [Zabbix最简易安装部署:基于docker容器](https://blog.csdn.net/weixin_66651551/article/details/128882409)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值