码迷,mamicode.com
首页 > 其他好文 > 详细

Zabbix-CentOS7下zabbix的安装与配置

时间:2018-05-16 19:52:34      阅读:181      评论:0      收藏:0      [点我收藏+]

标签:添加   png   .gz   make   系统监控   err   can   pts   htm   

前述

  Zabbix是基于Web界面的分布式系统监控的企业级开源软件。可以监控各种系统与设备,网络参数,保证服务器设备安全运营;提供灵活的通知机制。这里搭建的是LNMP环境下的zabbix

操作

  步骤1: 安装MySQL

    http://www.cnblogs.com/qq1207501666/p/9032693.html

  步骤2: 安装PHP

     tar -zxvf php-5.6.36.tar.gz && cd php-5.6.36 

    ./configure --prefix=/local/server/php --with-config-file-path=/local/server/php/etc  --with-jpeg-dir --with-png-dir --with-iconv-dir --enable-calendar  --with-curl --with-freetype-dir --with-gd --with-gettext --with-kerberos --with-libxml-dir --with-mysql --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear  --with-xmlrpc --with-xsl --with-zlib --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-gd-native-ttf --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-xml --enable-dom --enable-zip --with-libdir=lib64  --with-ldap

    报错:
      configure: error: jpeglib.h not found.
    解决:
      yum -y install libjpeg-devel
    报错:
      configure: error: png.h not found.
    解决:
      yum -y install libpng-devel
    报错:
      configure: error: freetype-config not found.
    解决:
      yum -y install freetype-devel
    报错:
      configure: error: Cannot find ldap.h
    解决:
      yum -y install openldap-devel
    报错:
      configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
    解决:
      yum -y install libxslt-devel

     make && make install 

     cp /local/software/php-5.6.36/php.ini-production /local/server/php/etc/php.ini 

     cp /local/server/php/etc/php-fpm.conf.default /local/server/php/etc/php-fpm.conf 

    修改php.ini(zabbix硬性要求)
      max_execution_time = 300
      memory_limit = 128M
      post_max_size = 16M
      upload_max_filesize = 2M
      max_input_time = 300
      date.timezone = PRC
      修改php-fpm.conf
        pid = run/php-fpm.pid 
        error_log = log/php-fpm.log
        log_level = notice

   步骤3: 安装Nginx

     yum -y install pcre-devel 

     yum -y install openssl-devel 

     tar -zxvf nginx-1.10.1.tar.gz && cd nginx-1.10.1 

     ./configure --prefix=/local/server/nginx --with-pcre --with-http_ssl_module --with-http_stub_status_module  

     make && make install 

  步骤4: 安装zabbix_server

     groupadd zabbix 

     useradd zabbix -g zabbix -s /sbin/nologin 

     tar -zxvf zabbix-3.4.8.tar.gz && cd zabbix-3.4.8 

     ./configure --prefix=/local/server/zabbix --enable-server --enable-agent --with-net-snmp --with-proxy --with-libcurl --with-libxml2 --with-mysql 

    报错:
      configure: error: no acceptable C compiler found in $PATH
    解决:
      yum -y install gcc-c++
    报错:
      configure: error: MySQL library not found
    解决:
      yum -y install mysql-community-devel
    报错:
      configure: error: LIBXML2 library not found
    解决:
      yum -y install libxml2-devel
    报错:
      configure: error: Invalid Net-SNMP directory - unable to find net-snmp-config
    解决:
      yum -y install net-snmp-devel
    报错:
      configure: error: Unable to use libevent (libevent check failed)
    解决:
      yum -y install libevent-devel
    报错:
      configure: error: Curl library not found
    解决:
      yum -y install curl-devel

     make && make install 

     cp -a /local/software/zabbix-3.4.8/misc/init.d/fedora/core/* /etc/init.d/ 

     vim /etc/init.d/zabbix_server.sh 

    修改:

      BASEDIR=/local/server/zabbix

     vim /local/server/zabbix/etc/zabbix_server.conf 

    修改:   

      DBHost=172.16.100.64
      DBName=zabbix
      DBUser=zabbix
      DBPassword=zhcwadmin
      DBPort=3306
      AlertScriptsPath=/local/server/zabbix/share/zabbix/alertscripts

     /etc/init.d/zabbix_agent start | stop | restart 


 

备注(zabbix客户端的安装)

  1.添加组和用户

    groupadd zabbix

    useradd zabbix -g zabbix -s /sbin/nologin

  2.编译

    tar -zxvf zabbix-3.4.8.tar.gz && cd zabbix-3.4.8

    ./configure --prefix=/local/server/zabbix --enable-agent

  3.安装

    make && make install

  4.复制重启脚本

    cp -a /local/software/zabbix-3.4.8/misc/init.d/fedora/core/zabbix_agent /etc/init.d/zabbix_agent

  5.修改配置

    vim /local/server/zabbix/etc/zabbix_agentd.conf

    Hostname=本机内网ip

    ServerActive=172.16.100.94

    Server=172.16.100.94

  6.启动、停止、重启

    /etc/init.d/zabbix_agent start | stop | restart

 

Zabbix-CentOS7下zabbix的安装与配置

标签:添加   png   .gz   make   系统监控   err   can   pts   htm   

原文地址:https://www.cnblogs.com/qq1207501666/p/9047545.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!