已有LNMP环境。
1、安装zabbix需要的依赖包,红色部门的包官方yum源没有,需要自己下载
yum install net-snmp fping iksemel net-snmp-devel
 
2、创建zabbx用户,
groupadd zabbix
useradd zabbix -g zabbix
mkdir /usr/local/zabbix
chown zabbix:zabbix /usr/local/zabbix
usermod zabbix -s /sbin/nologin
 
3、数据库创建,并授权给zabbix用户
shell> mysql -uroot -p
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by '密码';
mysql> flush privileges;
mysql> quit;
 
4、将zabbix数据库文件导入mysql,导入数据的时候有可能导入不了,请重新在数据库里面刷新权限,重新试试。
cd /usr/src/zabbix-3.2.2/database/mysql/
mysql -uzabbix –p zabbix <schema.sql
mysql -uzabbix -p zabbix <images.sql
mysql -uzabbix -p zabbix <data.sql
 
5、编译zabbix
./configure --prefix=/usr/local/zabbix \
--enable-server \
--enable-agent \
--with-net-snmp \
--with-mysql \
--with-libcurl \
--with-libxml2
 
make
make install
 
 
 
6、将php文件拷贝到你的反向代理程序的web目录,将启动脚本放到zabbix主目录中
cd /usr/src/zabbix-3.2.2/frontends/php
cp -a . /usr/local/nginx/html
chown -R nginx:nginx /usr/local/nginx/html
ln -s /usr/local/zabbix/sbin/* /usr/local/sbin/
ln -s /usr/local/zabbix/bin/* /usr/local/bin/
echo "/usr/local/mysql/lib" >> /etc/ld.so.conf
ldconfig
 
cp /usr/src/zabbix-3.2.2/misc/init.d/fedora/core/zabbix_server /usr/local/zabbix/
cp /usr/src/zabbix-3.2.2/misc/init.d/fedora/core/zabbix_agentd /usr/local/zabbix/
 
 
7、更改zabbix_server.conf配置文件
 
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
 
 
8、启动zabbix程序
 
[root@cloud zabbix]# ./zabbix_server start
登录http://ip,配置相关GUI参数
 
 
 
 
附录:
 
[root@cloud zabbix-3.2.2]# ./configure --help
`configure' configures Zabbix 3.2.2 to adapt to many kinds of systems.
 
Usage: ./configure [OPTION]... [VAR=VALUE]...
 
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.
 
Defaults for the options are specified in brackets.
 
Configuration:
  -h, --help              display this help and exit
      --help=short        display options specific to this package
      --help=recursive    display the short help of all the included packages
  -V, --version           display version information and exit
  -q, --quiet, --silent   do not print `checking ...' messages
      --cache-file=FILE   cache test results in FILE [disabled]
  -C, --config-cache      alias for `--cache-file=config.cache'
  -n, --no-create         do not create output files
      --srcdir=DIR        find the sources in DIR [configure dir or `..']
 
Installation directories:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [/usr/local]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [PREFIX]
 
By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc.  You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.
 
For better control, use the options below.
 
Fine tuning of the installation directories:
  --bindir=DIR            user executables [EPREFIX/bin]
  --sbindir=DIR           system admin executables [EPREFIX/sbin]
  --libexecdir=DIR        program executables [EPREFIX/libexec]
  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
  --libdir=DIR            object code libraries [EPREFIX/lib]
  --includedir=DIR        C header files [PREFIX/include]
  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
  --infodir=DIR           info documentation [DATAROOTDIR/info]
  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
  --mandir=DIR            man documentation [DATAROOTDIR/man]
  --docdir=DIR            documentation root [DATAROOTDIR/doc/zabbix]
  --htmldir=DIR           html documentation [DOCDIR]
  --dvidir=DIR            dvi documentation [DOCDIR]
  --pdfdir=DIR            pdf documentation [DOCDIR]
  --psdir=DIR             ps documentation [DOCDIR]
 
Program names:
  --program-prefix=PREFIX            prepend PREFIX to installed program names
  --program-suffix=SUFFIX            append SUFFIX to installed program names
  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
 
System types:
  --build=BUILD     configure for building on BUILD [guessed]
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
 
Optional Features:
  --disable-option-checking  ignore unrecognized --enable/--with options
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --enable-silent-rules   less verbose build output (undo: "make V=1")
  --disable-silent-rules  verbose build output (undo: "make V=0")
  --enable-dependency-tracking
                          do not reject slow dependency extractors
  --disable-dependency-tracking
                          speeds up one-time build
  --disable-largefile     omit support for large files
  --enable-static         Build statically linked binaries
  --enable-server         Turn on build of Zabbix server
  --enable-proxy          Turn on build of Zabbix proxy
  --enable-agent          Turn on build of Zabbix agent and client utilities
  --enable-java           Turn on build of Zabbix Java gateway
  --enable-ipv6           Turn on support of IPv6
 
Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-ibm-db2=[ARG]    use IBM DB2 CLI from given sqllib directory
                          (ARG=path); use /home/db2inst1/sqllib (ARG=yes);
                          disable IBM DB2 support (ARG=no)
  --with-ibm-db2-include=[DIR]
                          use IBM DB2 CLI headers from given path
  --with-ibm-db2-lib=[DIR]
                          use IBM DB2 CLI libraries from given path
  --with-mysql[=ARG]      use MySQL client library [default=no], optionally
                          specify path to mysql_config
  --with-oracle=[ARG]     use Oracle OCI API from given Oracle home
                          (ARG=path); use existing ORACLE_HOME (ARG=yes);
                          disable Oracle OCI support (ARG=no)
  --with-oracle-include=[DIR]
                          use Oracle OCI API headers from given path
  --with-oracle-lib=[DIR] use Oracle OCI API libraries from given path
  --with-postgresql[=ARG] use PostgreSQL library [default=no], optionally
                          specify path to pg_config
  --with-sqlite3[=ARG]    use SQLite 3 library [default=no], optionally
                          specify the prefix for sqlite3 library
 
If you want to use Jabber protocol for messaging:
  --with-jabber[=DIR]     Include Jabber support [default=no]. DIR is the
                          iksemel library install directory.
 
If you want to use XML library:
  --with-libxml2[=ARG]    use libxml2 client library [default=no], optionally
                          specify path to xml2-config
 
If you want to use unixODBC library:
  --with-unixodbc[=ARG]   use ODBC driver against unixODBC package
                          [default=no], optionally specify full path to
                          odbc_config binary.
 
If you want to use Net-SNMP library:
  --with-net-snmp[=ARG]   use Net-SNMP package [default=no], optionally
                          specify path to net-snmp-config
 
If you want to use SSH2 based checks:
  --with-ssh2[=DIR]       use SSH2 package [default=no], DIR is the SSH2
                          library install directory.
 
If you want to check IPMI devices:
  --with-openipmi[=DIR]   Include OPENIPMI support [default=no]. DIR is the
                          OPENIPMI base install directory, default is to
                          search through a number of common places for the
                          OPENIPMI files.
 
If you want to use encryption provided by mbed TLS (PolarSSL) library:
  --with-mbedtls[=DIR]    use mbed TLS (PolarSSL) package [default=no], DIR is
                          the libpolarssl install directory.
 
If you want to use encryption provided by GnuTLS library:
  --with-gnutls[=DIR]     use GnuTLS package [default=no], DIR is the
                          libgnutls install directory.
 
If you want to use encryption provided by OpenSSL library:
  --with-openssl[=DIR]    use OpenSSL package [default=no], DIR is the libssl
                          and libcrypto install directory.
 
If you want to check LDAP servers:
  --with-ldap[=DIR]       Include LDAP support [default=no]. DIR is the LDAP
                          base install directory, default is to search through
                          a number of common places for the LDAP files.
 
If you want to use cURL library:
  --with-libcurl[=DIR]    use cURL package [default=no], optionally specify
                          path to curl-config
 
If you want to specify iconv installation directories:
  --with-iconv=[DIR]      use iconv from given base install directory (DIR),
                          default is to search through a number of common
                          places for the iconv files.
  --with-iconv-include=[DIR]
                          use iconv include headers from given path.
  --with-iconv-lib=[DIR]  use iconv libraries from given path.
 
Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  LIBS        libraries to pass to the linker, e.g. -l<library>
  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
              you have headers in a nonstandard directory <include dir>
  CPP         C preprocessor
  PKG_CONFIG  path to pkg-config utility
  PKG_CONFIG_PATH
              directories to add to pkg-config's search path
  PKG_CONFIG_LIBDIR
              path overriding pkg-config's built-in search path
  IKSEMEL_CFLAGS
              C compiler flags for IKSEMEL, overriding pkg-config
  IKSEMEL_LIBS
              linker flags for IKSEMEL, overriding pkg-config
 
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
 
Report bugs to the package provider.

centos 7 编译zabbix 3.2.2的更多相关文章

  1. centos下编译安装lnmp

    centos下编译安装lnmp 本文以centos为背景在其中编译安装nginx搭建lnmp环境. 编译安装nginx时,需要事先安装 开发包组"Development Tools" ...

  2. CentOS 7 编译安装 Code::Blocks

    CentOS 7 编译安装 Code::Blocks yum install cairo-devel yum install pango-devel yum install atk-devel yum ...

  3. 在Linux CentOS上编译CoreCLR

    经过几天的努力,终于解决了在CentOS上编译CoreCLR的问题.最终发现问题是CMAKE_C_FLAGS的设置引起的. 只要在“src/pal/tools/clang-compiler-overr ...

  4. linux centos安装编译phantomjs 2.0的方法

    phantomjs 2.0最新版的官方不提供编译好的文件下载,只能自己编译,有教程但是过于简单,特别是服务器上要安装N多的支持.折腾到现在终于装好了并且能正常运行了,截图mark一下: linux c ...

  5. centos mysql 编译安装

    centos mysql 编译安装 1.安装 创建MySQL用户 sudo useradd mysql 下载MySQL的源码包,我们这里使用的时5.5.18 安装依赖 sudo yum -y inst ...

  6. 64位 CentOS NDK 编译 FFMPEG

    64位 CentOS NDK 编译 FFMPEG 一.           参考文章: http://www.cnblogs.com/baopu/p/4733029.html http://www.c ...

  7. centos 6 安装zabbix 3.0

    1.安装PHP Zabbix 3.0对PHP的要求最低为5.4,而CentOS6默认为5.3.3,完全不满足要求,故需要利用第三方源,将PHP升级到5.4以上,注意,不支持PHP7 rpm -ivh  ...

  8. centos 安装部署zabbix

    Zabbix_server初始安装部署 各模块要安装的模块 Server:server+nginx+mysql+php Agentd:agentd Proxy:proxy+mysql 1.准备环境: ...

  9. Ubuntu/CentOS下编译Nginx最基本参数

    Ubuntu/CentOS下编译Nginx安装基本参数,做个记录: groupadd www useradd -g www www ./configure --user=www --group=www ...

随机推荐

  1. 基于webpack使用ES6新特性(转载)

    本文转载自: http://www.tuicool.com/articles/vye2ea6

  2. Python快速建站系列-Part.Six-文章内容浏览

    |版权声明:本文为博主原创文章,未经博主允许不得转载. 其实到这里网站的基本功能已经完成一半了,第六节就完成文章内容的阅读功能. 完成blogview.html↓ {% extends "m ...

  3. 无语啊,sublime给我弄乱玩,玩坏了,而且安装插件也安装不了

    国内的什么插件地址都TMMD失效了,没办法,只能翻"强"到外面找了,而且找了很多也用不了,所以收藏一个为了预防以后不行有补救的方法: 百度的99%都不行,不是报这个错就是那个错,可 ...

  4. python学习笔记系列----(六)错误和异常

    python至少有2类不同的错误:语法错误(Syntax Errors)和异常(Exceptions). 8.1 语法错误 这个单词应该还是很有必要认识的,呵呵,语法错误,也叫解析错误,是我们最不愿意 ...

  5. java代码优化

    优化通常包含两方面的内容:减小代码的体积,提高代码的运行效率. 1.尽量指定类的final修饰符 带有final修饰符的类是不可派生的.在Java核心API中,有许多应用final的例子,例如java ...

  6. ZwQuerySystemInformation 安全使用心得 Delphi 版

    作为 DELPHI 版本,需要引用 jwaNative, JwaWinType ,他们是 JEDI API 的一部分.JEDI 官网有下载. 先给出 2 个辅助函数 和 一些结构体. type     ...

  7. Android EditText中插入话题模块的删除处理方法

    在 EditText 中添加话题 或者是 @某人 时 看起来挺简单,实际操作会有很多坑爹的问题 private String mTopic: //光标保持在话题的末尾 mInputEdit.setOn ...

  8. C# DllImport“调用导致堆栈不对称。原因可能是托管的 PInvoke 签名与非托管的目标签名不匹配。请检查 PInvoke 签名的调用约定和参数与非托管的目标签名是否匹配 ”

    调用外部dll时,出现如下问题 C# DllImport“调用导致堆栈不对称.原因可能是托管的 PInvoke 签名与非托管的目标签名不匹配.请检查 PInvoke 签名的调用约定和参数与非托管的目标 ...

  9. 《编写可维护的JavaScript》——JavaScript编码规范(六)

    变量.函数和运算符 在讨论过基本的JavaScript书写格式化之后,接下来关注如何使用函数.变量和运算符来减少复杂度和增强可读性就显得十分重要了. 变量声明 变量声明是通过var语句来完成的.var ...

  10. 【GO】GO语言学习笔记三

    7.数组: 几乎是最常用的数据类型了... 数组就是指一系列同一类型数据 的集合.数组中包含的每个数据被称为数组元素(element),一个数组包含的元素个数被称为数 组的长度. 常规的数组声明方法: ...