1. 程式人生 > >zabbix部署

zabbix部署

put XML size 前端 -a use ini rip dbn

1 nginx

./configure --prefix=/app/nginx --with-http_ssl_module --with-http_stub_status_module --with-pcre
make && make install
location ~ \.php$ {
    root           /data/jab.com/;
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    include        fastcgi_params;
}
#修改conf配置

  

2 mariadb

yum -y install mariadb mariadb-serve
mysqladmin -uroot password root
 create database zabbix default charset utf8;

  

3 php

yum install -y bzip* *libxml2* libjpeg-devel libpng-devel freetype-devel libcurl*
./configure  --prefix=/app/php-5.6.36 --with-bz2 --with-curl --enable-ftp --enable-sockets --disable-ipv6 --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-freetype-dir=/usr/local --enable-gd-native-ttf --with-iconv-dir=/usr/local --enable-mbstring --enable-calendar --with-gettext --with-libxml-dir=/usr/local --with-zlib --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-mysql=mysqlnd --enable-dom --enable-xml --enable-fpm --with-libdir=lib64 --enable-bcmath
cp php.ini-development /app/php-5.6.36/lib/php.ini
cd /app/php-5.6.36/etc
cp php-fpm.conf.default php-fpm.conf
 max_execution_time = 300
 memory_limit = 128M
 post_max_size = 16M
 upload_max_filesize = 2M
 max_input_time = 300
 date.timezone PRC
 always_populate_raw_post_data = -1
#php.ini中zabbix的配置要求

  

4 zabbix

yum install net-snmp-devel mysql-devel libevent* -y
./configure --prefix=/app/zabbix/ --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml
groupadd zabbix
useradd -g zabbix zabbix
mysql -uroot -proot zabbix < database/mysql/schema.sql
mysql -uroot -proot zabbix < database/mysql/images.sql
mysql -uroot -proot zabbix < database/mysql/data.sql
DBName=zabbix
DBUser=root
DBPassword=root
DBPort=3306
#修改zabbix服務端配置文件
cp -a /data/zabbix-3.4.11/frontends/php/* /app/nginx/html/
#把前端文件cp到nginx

 

5 部署zabbix

進ip/index.php就可以進行配置了。

zabbix部署