您好,欢迎来到刀刀网。
搜索
您的当前位置:首页基于LNMP的Zabbbix之Zabbix Server源码详细安装,但不给图

基于LNMP的Zabbbix之Zabbix Server源码详细安装,但不给图

来源:刀刀网

            Zabbix Server安装

看到那里有错或者有什么问题的话,求指点

邮箱:losbyday@163.com

上一篇PHP源码安装参见基于LNMP的Zabbbix之PHP源码安装:

关于zabbix详细:


              Begin

#建立一个用于zabbix的用户

    useradd zabbix
    passwd zabbix
#我的密码123看个人

#到官网找到Zabbix Server源码安装包

   wget  http://120.52.73.49/tenet.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.0.3/zabbix-3.0.3.tar.gz
   tar -zxvf zabbix-3.0.3.tar.gz
   cd zabbix-3.0.3
   ./configure --prefix=/usr/local/zabbix/ --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2 --enable-java
   make && make install

#MySQL导入SQL语句

    mysql -uroot -e"create database zabbix character set utf8 collate utf8_bin;"
    mysql -uroot -e"grant all privileges on zabbix.* to zabbix@'%' identified by 'losnau';"
    mysql -uroot -e"flush privileges;"

#按照SQL语句顺序导入SQL:

    mysql -uzabbix -plosnau zabbix <  /usr/local/setup/zabbix-3.0.3/database/mysql/schema.sql
    mysql -uzabbix -plosnau zabbix < /usr/local/setup/zabbix-3.0.3/database/mysql/images.sql
    mysql -uzabbix -plosnau zabbix < /usr/local/setup/zabbix-3.0.3/database/mysql/data.sql

#修改/usr/local/zabbix/etc/zabbix_server.conf

    DBName=zabbix #数据库名称
    DBUser=zabbix #数据库用户名
    DBPassword=losnau #数据库密码
    ListenIP=192.168.1.5 #数据库ip地址
    AlertScriptsPath=${datadir}/zabbix/alertscripts #zabbix运行脚本存放目录

#修改php.ini                ------PHP option

    post_max_size 16M
    max_execution_time 300
    max_input_time = 300
#    zone Asia/Shanghai

#重启php-fpm服务

  ps aux |grep php    #查看php-fpm是否开启
  #如果开启就
  ps aux |grep php-fpm |xargs kill -9    # 关闭啦
  cp /usr/local/php/sbin/php-fpm /usr/bin    #^_^
  php-fmp                            #启动php-fpm服务

#zabbix提供init.d脚本

cp misc/init.d/tru/zabbix_* /etc/init.d/


chmod +x /etc/init.d/zabbix_*

 

    cd /usr/local/setup/zabbix-3.0.3/frontends   #进入zabbix解压缩目录 
    cp -rf php /www                    #将解压缩的zabbix里面php文件拷贝到nginx的root目录下

#修改Nginx的配置文件

我的nginx.conf如下

 # 重启Nginx

 #启动服务

    /usr/local/zabbix/sbin/zabbix_server
    /usr/local/zabbix/sbin/zabbix_agentd 
或者service zabbix_server start
service zabbix_agentd start

 #在web 192.168.1.5,看你怎么配置的了

  zabbix初始登录帐号:Admin   #A必须大写

  密码:zabbix

               End


 

#碰到的错误及解决:

------------------------check-error 1-------------------------------------------------

   #checking for net-snmp-config... no
    #configure: error: Invalid Net-SNMP directory - unable to find net-snmp-config
    #提示unable to find net-snmp-config,说明缺少相关的依赖性,找出net-snmp-config属于哪个软件包,然后安装即可。
    #yum search net-snmp-config,发现net-snmp-config属于软件包net-snmp-devel,安装该软件包,解决该问题。

yum install net-snmp*

------------------------check-error 2--------------------------------------------------
    #checking for javac... no
    #configure: error: Unable to find "javac" executable in path,没装java-jdk

#解决

 

------------------------MySQL导入SQL语句错误 3----------------------------------------

#Warning: Using a password on the command line interface can be insecure.
#ERROR 1045 (28000): Access denied for user 'zabbix'@'localhost' (using password: YES)

    mysql -uroot -e"delete from user where user=' ';"
    mysql -uroot -e"flush privileges;"

------------------------打开网页出现403错误  4----------------------------------------

403有很多原因,查看logs有( FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream)

错误解决方法:在Nginx配置文件中找到定义调用脚本文件的地方

  #fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;    #注释
  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;  #添加

提示:$document_root 代表当前请求在root指令中指定的值。

------------------------nginx日志中还看到下面那个错误 5-------------------------------

open() “/usr/local/nginx/html/favicon.ico” failed (2: No such file or directory)
只需要关闭 favicon.ico 的 log:

    location = /favicon.ico {
        log_not_found off;
        access_log off;
    } 

-----------------------nginx日志中还看到下面那个错误 6-------------------------------

-2016/09/01 11:05:15 [error] 118206#118206: *1 FastCGI sent in stderr: "PHP message: PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /www/index.php on line 2" while reading response header from upstream, client: 192.168.1.209, server: localhost, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://unix:/tmp/phpfpm.sock:", host: "192.168.1.5"

解决方法:
在php.ini里加上
date.timezone = "Asia/Shanghai"(去掉前面的;)

-----------------------zabbix 服务启动错误  7-------------------------------

[root@localhost mysql]# /usr/local/zabbix/sbin/zabbix_server                    
/usr/local/zabbix/sbin/zabbix_server: error while loading shared libraries:
libmysqlclient.so.18: cannot open shared object file: No such file or directory

  ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib/  
  # 如果是32位系统需要做连接到/usr/lib/下 位放到lib

------------------------Nginx 错误汇总:

------------------------zabbix密码修改:

------------------------本文参考:

记录一次基于LNMP环境下的Zabbix3.0部署:

Zabbix安装图解教程:

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- gamedaodao.com 版权所有 湘ICP备2022005869号-6

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务