zabbix源码编译安装以及添加第一台host监控
基础准备
硬件需求
数据库需求
软件需求
其他软件需求
安装
安装方式
- source code
- 编译好的二进制包
- rpm或者deb
源码编译安装部署zabbix以及附件
前提准备
- 最小化安装操作系统
- 分配好IP(内网外网ip设定)
- 关闭selinux
- 关闭firewalld
- 时间同步
[root@linux-node1 conf]# yum -y install ntp ntpdate
[root@linux-node1 conf]# systemctl restart ntpd
[root@linux-node1 conf]# ntpdate time.windows.com #时间同步
- [root@linux-node1 conf]# yum -y install ntp ntpdate
- [root@linux-node1 conf]# systemctl restart ntpd
- [root@linux-node1 conf]# ntpdate time.windows.com #时间同步
zabbix-server安装
环境准备
- OS:CentOS Linux release 7.3.1611 (Core)
- zabbix:https://jaist.dl.sourceforge.net/project/zabbix/ZABBIX Latest Stable/3.2.7/zabbix-3.2.7.tar.gz
- Nginx:http://www.nginx.org/download/nginx-1.12.1.tar.gz
- mysql:https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz
- php:http://cn2.php.net/distributions/php-5.6.31.tar.xz
- jdk1.8:http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.rpm?AuthParam=1504418803_96caf675c8af37c08b7a8890c20e0ec8
- hostname:linux-node1
- IP:192.168.56.11
- baseurl:/opt
[root@linux-node1 ~]# hostname
linux-node1
[root@linux-node1 ~]# hostname -I
192.168.56.11 192.168.64.129
[root@linux-node1 ~]# mkdir /opt/tools
[root@linux-node1 ~]# cd /opt/tools
[root@linux-node1 tools]# wget https://jaist.dl.sourceforge.net/project/zabbix/ZABBIX Latest Stable/3.2.7/zabbix-3.2.7.tar.gz
[root@linux-node1 tools]# wget http://www.nginx.org/download/nginx-1.12.1.tar.gz
[root@linux-node1 tools]# wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz
[root@linux-node1 tools]# wget http://cn2.php.net/distributions/php-5.6.31.tar.xz
[root@linux-node1 tools]# wget http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.rpm?AuthParam=1504418803_96caf675c8af37c08b7a8890c20e0ec8
[root@linux-node1 tools]# rpm -ivh jdk-8u144-linux-x64.rpm
[root@linux-node1 ~]# yum -y install gcc-c++ zlib zlib-devel openssl openssl-devel pcre pcre-devel gd curl curl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel gcc gcc-c++ cmake ncurses-devel bison zlib-devel libaio gd curl curl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel bzip2 bzip2-devel
- x
- [root@linux-node1 ~]# hostname
- linux-node1
- [root@linux-node1 ~]# hostname -I
- 192.168.56.11 192.168.64.129
- [root@linux-node1 ~]# mkdir /opt/tools
- [root@linux-node1 ~]# cd /opt/tools
- [root@linux-node1 tools]# wget https://jaist.dl.sourceforge.net/project/zabbix/ZABBIX Latest Stable/3.2.7/zabbix-3.2.7.tar.gz
- [root@linux-node1 tools]# wget http://www.nginx.org/download/nginx-1.12.1.tar.gz
- [root@linux-node1 tools]# wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz
- [root@linux-node1 tools]# wget http://cn2.php.net/distributions/php-5.6.31.tar.xz
- [root@linux-node1 tools]# wget http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.rpm?AuthParam=1504418803_96caf675c8af37c08b7a8890c20e0ec8
- [root@linux-node1 tools]# rpm -ivh jdk-8u144-linux-x64.rpm
- [root@linux-node1 ~]# yum -y install gcc-c++ zlib zlib-devel openssl openssl-devel pcre pcre-devel gd curl curl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel gcc gcc-c++ cmake ncurses-devel bison zlib-devel libaio gd curl curl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel bzip2 bzip2-devel
nginx安装
[root@linux-node1 ~]# cd /opt/tools/
[root@linux-node1 tools]# tar xf nginx-1.12.1.tar.gz
[root@linux-node1 tools]# cd nginx-1.12.1
[root@linux-node1 nginx-1.12.1]# vim src/core/nginx.h
#define nginx_version 998
#define NGINX_VERSION "9.9.8"
#define NGINX_VER "Apache/" NGINX_VERSION
#define NGINX_VAR "Apache"
[root@linux-node1 nginx-1.12.1]# vim src/http/ngx_http_header_filter_module.c
static u_char ngx_http_server_string[] = "Server: Apache" CRLF;
[root@linux-node1 nginx-1.12.1]# vim src/http/ngx_http_special_response.c
static u_char ngx_http_error_full_tail[] =
"<hr><center>" NGINX_VER "</center>" CRLF
"</body>" CRLF
"</html>" CRLF
;
static u_char ngx_http_error_build_tail[] =
"<hr><center>" NGINX_VER_BUILD "</center>" CRLF
"</body>" CRLF
"</html>" CRLF
[root@linux-node1 nginx-1.12.1]# ./configure --prefix=/opt/application/nginx --with-http_stub_status_module --with-http_realip_module --with-http_addition_module --with-pcre --with-http_gzip_static_module --with-http_random_index_module --with-http_sub_module --with-http_dav_module --with-http_ssl_module
[root@linux-node1 nginx-1.12.1]# make && make install
- x
- [root@linux-node1 ~]# cd /opt/tools/
- [root@linux-node1 tools]# tar xf nginx-1.12.1.tar.gz
- [root@linux-node1 tools]# cd nginx-1.12.1
- [root@linux-node1 nginx-1.12.1]# vim src/core/nginx.h
- #define nginx_version 998
- #define NGINX_VERSION "9.9.8"
- #define NGINX_VER "Apache/" NGINX_VERSION
- #define NGINX_VAR "Apache"
- [root@linux-node1 nginx-1.12.1]# vim src/http/ngx_http_header_filter_module.c
- static u_char ngx_http_server_string[] = "Server: Apache" CRLF;
- [root@linux-node1 nginx-1.12.1]# vim src/http/ngx_http_special_response.c
- static u_char ngx_http_error_full_tail[] =
- "<hr><center>" NGINX_VER "</center>" CRLF
- "</body>" CRLF
- "</html>" CRLF
- ;
- static u_char ngx_http_error_build_tail[] =
- "<hr><center>" NGINX_VER_BUILD "</center>" CRLF
- "</body>" CRLF
- "</html>" CRLF
- [root@linux-node1 nginx-1.12.1]# ./configure --prefix=/opt/application/nginx --with-http_stub_status_module --with-http_realip_module --with-http_addition_module --with-pcre --with-http_gzip_static_module --with-http_random_index_module --with-http_sub_module --with-http_dav_module --with-http_ssl_module
- [root@linux-node1 nginx-1.12.1]# make && make install
mysql安装
[root@linux-node1 ~]# groupadd mysql
[root@linux-node1 ~]# useradd -g mysql -s /sbin/nologin -M mysql
[root@linux-node1 ~]# cd /opt/tools/
[root@linux-node1 tools]# tar xf mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz
[root@linux-node1 tools]# mv mysql-5.7.19-linux-glibc2.12-x86_64 /opt/application/mysql
[root@linux-node1 tools]# cd /opt/application/mysql
[root@linux-node1 mysql]# useradd -s /sbin/nologin -M mysql
[root@linux-node1 mysql]# /opt/application/mysql/bin/mysqld --user=mysql --basedir=/opt/application/mysql --datadir=/opt/application/data --initialize
2017-09-02T14:59:34.959312Z 1 [Note] A temporary password is generated for root@localhost: VOFZIVorO4,W #此处有密码则表示安装成功
[root@linux-node1 mysql]# ln -s /opt/application/mysql/bin/* /usr/bin/
[root@linux-node1 mysql]# vim /etc/my.cnf #修改配置文件
[client]
port = 3306
socket = /tmp/mysql.sock
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
symbolic-links = 0
log-bin=mysql-bin
binlog_format=mixed
server-id = 1
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
[root@linux-node1 mysql]# vim /opt/application/mysql/support-files/mysql.server
basedir=/opt/application/mysql/
datadir=/opt/application/data/
[root@linux-node1 mysql]# cp /opt/application/mysql/support-files/mysql.server /etc/init.d/mysql
[root@linux-node1 mysql]# /etc/init.d/mysql start
Starting MySQL.Logging to '/opt/application/data/linux-node1.err'.
SUCCESS! #启动成功
[root@linux-node1 mysql]# mysql -pVOFZIVorO4,W #进入程序
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.19-log
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> set password = password('woshiniba8');
mysql> alter user 'root'@'localhost' password expire never;
mysql> grant all privileges on *.* to root@'localhost' identified by 'woshiniba8';
mysql> flush privileges;
mysql> exit
- [root@linux-node1 ~]# groupadd mysql
- [root@linux-node1 ~]# useradd -g mysql -s /sbin/nologin -M mysql
- [root@linux-node1 ~]# cd /opt/tools/
- [root@linux-node1 tools]# tar xf mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz
- [root@linux-node1 tools]# mv mysql-5.7.19-linux-glibc2.12-x86_64 /opt/application/mysql
- [root@linux-node1 tools]# cd /opt/application/mysql
- [root@linux-node1 mysql]# useradd -s /sbin/nologin -M mysql
- [root@linux-node1 mysql]# /opt/application/mysql/bin/mysqld --user=mysql --basedir=/opt/application/mysql --datadir=/opt/application/data --initialize
- 2017-09-02T14:59:34.959312Z 1 [Note] A temporary password is generated for root@localhost: VOFZIVorO4,W #此处有密码则表示安装成功
- [root@linux-node1 mysql]# ln -s /opt/application/mysql/bin/* /usr/bin/
- [root@linux-node1 mysql]# vim /etc/my.cnf #修改配置文件
- [client]
- port = 3306
- socket = /tmp/mysql.sock
- [mysqld]
- port = 3306
- socket = /tmp/mysql.sock
- skip-external-locking
- key_buffer_size = 16M
- max_allowed_packet = 1M
- table_open_cache = 64
- sort_buffer_size = 512K
- net_buffer_length = 8K
- read_buffer_size = 256K
- read_rnd_buffer_size = 512K
- myisam_sort_buffer_size = 8M
- symbolic-links = 0
- log-bin=mysql-bin
- binlog_format=mixed
- server-id = 1
- [mysqldump]
- quick
- max_allowed_packet = 16M
- [mysql]
- no-auto-rehash
- [myisamchk]
- key_buffer_size = 20M
- sort_buffer_size = 20M
- read_buffer = 2M
- write_buffer = 2M
- [mysqlhotcopy]
- interactive-timeout
- [root@linux-node1 mysql]# vim /opt/application/mysql/support-files/mysql.server
- basedir=/opt/application/mysql/
- datadir=/opt/application/data/
- [root@linux-node1 mysql]# cp /opt/application/mysql/support-files/mysql.server /etc/init.d/mysql
- [root@linux-node1 mysql]# /etc/init.d/mysql start
- Starting MySQL.Logging to '/opt/application/data/linux-node1.err'.
- SUCCESS! #启动成功
- [root@linux-node1 mysql]# mysql -pVOFZIVorO4,W #进入程序
- Enter password:
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 3
- Server version: 5.7.19-log
- Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
- Oracle is a registered trademark of Oracle Corporation and/or its
- affiliates. Other names may be trademarks of their respective
- owners.
- Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
- mysql> set password = password('woshiniba8');
- mysql> alter user 'root'@'localhost' password expire never;
- mysql> grant all privileges on *.* to root@'localhost' identified by 'woshiniba8';
- mysql> flush privileges;
- mysql> exit
php安装
- libiconv字符集转换库
[root@linux-node1 ~]# cd /opt/tools/
[root@linux-node1 tools]# wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
[root@linux-node1 tools]# tar xf libiconv-1.14.tar.gz
[root@linux-node1 tools]# cd libiconv-1.14
[root@linux-node1 libiconv-1.14]# ./configure --prefix=/usr/local/libiconv
[root@linux-node1 libiconv-1.14]# vim srclib/stdio.in.h 修改698行如下:
#if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16)
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
#endif
[root@linux-node1 libiconv-1.14]# make && make install
- x
- [root@linux-node1 ~]# cd /opt/tools/
- [root@linux-node1 tools]# wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
- [root@linux-node1 tools]# tar xf libiconv-1.14.tar.gz
- [root@linux-node1 tools]# cd libiconv-1.14
- [root@linux-node1 libiconv-1.14]# ./configure --prefix=/usr/local/libiconv
- [root@linux-node1 libiconv-1.14]# vim srclib/stdio.in.h 修改698行如下:
- #if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16)
- _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
- #endif
- [root@linux-node1 libiconv-1.14]# make && make install
- libmcrypt加密算法拓展库
[root@linux-node1 ~]# cd /opt/tools/
[root@linux-node1 tools]# wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz
[root@linux-node1 tools]# tar xf libmcrypt-2.5.7.tar.gz
[root@linux-node1 tools]# cd libmcrypt-2.5.7
[root@linux-node1 libmcrypt-2.5.7]# ./configure && make && make install
- x
- [root@linux-node1 ~]# cd /opt/tools/
- [root@linux-node1 tools]# wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz
- [root@linux-node1 tools]# tar xf libmcrypt-2.5.7.tar.gz
- [root@linux-node1 tools]# cd libmcrypt-2.5.7
- [root@linux-node1 libmcrypt-2.5.7]# ./configure && make && make install
- php安装
[root@linux-node1 ~]# cd /opt/tools/
[root@linux-node1 tools]# tar xf php-5.6.31.tar.xz
[root@linux-node1 tools]# cd php-5.6.31
[root@linux-node1 php-5.6.31]# ./configure --prefix=/opt/application/php --with-config-file-path=/opt/application/php/etc --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 --with-mysqli --with-mysql --enable-dom --enable-xml --enable-fpm --with-libdir=lib64 --enable-bcmath
[root@linux-node1 php-5.6.31]# make && make install
- x
- [root@linux-node1 ~]# cd /opt/tools/
- [root@linux-node1 tools]# tar xf php-5.6.31.tar.xz
- [root@linux-node1 tools]# cd php-5.6.31
- [root@linux-node1 php-5.6.31]# ./configure --prefix=/opt/application/php --with-config-file-path=/opt/application/php/etc --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 --with-mysqli --with-mysql --enable-dom --enable-xml --enable-fpm --with-libdir=lib64 --enable-bcmath
- [root@linux-node1 php-5.6.31]# make && make install
- zabbix安装(安装好server,agent,java-proxy,snmp,mysql等插件)
[root@linux-node1 ~]# groupadd zabbix
[root@linux-node1 ~]# useradd -g zabbix -s /sbin/nologin zabbix
[root@linux-node1 ~]# cd /opt/tools/
[root@linux-node1 tools]# tar xf zabbix-3.2.7.tar.gz
[root@linux-node1 tools]# cd zabbix-3.2.7
[root@linux-node1 zabbix-3.2.7]# yum -y install curl libcurl-devel net-snmp net-snmp-devel perl-DBI libdbi-dbd-mysql mysql-devel gcc gcc++ make libxml2 libxml2-devel java-devel
[root@linux-node1 zabbix-3.2.7]# ./configure --prefix=/opt/application/zabbix --enable-server --enable-java --enable-proxy --enable-agent --with-net-snmp --with-mysql=/opt/application/mysql/bin/mysql_config --with-libcurl --with-libxml2
[root@linux-node1 zabbix-3.2.7]# make && make install
[root@linux-node1 zabbix-3.2.7]# mkdir /opt/application/nginx/html/zabbix/
[root@linux-node1 zabbix-3.2.7]# cp -r frontends/php/* /opt/application/nginx/html/zabbix/
[root@linux-node1 zabbix-3.2.7]# l -s /opt/application/zabbix/sbin/* /usr/local/sbin/
[root@linux-node1 zabbix-3.2.7]# ln -s /opt/application/zabbix/bin/* /usr/local/bin/
[root@linux-node1 zabbix-3.2.7]# echo "/opt/application/mysql/lib" >> /etc/ld.so.conf
[root@linux-node1 zabbix-3.2.7]# ldconfig ll
- [root@linux-node1 ~]# groupadd zabbix
- [root@linux-node1 ~]# useradd -g zabbix -s /sbin/nologin zabbix
- [root@linux-node1 ~]# cd /opt/tools/
- [root@linux-node1 tools]# tar xf zabbix-3.2.7.tar.gz
- [root@linux-node1 tools]# cd zabbix-3.2.7
- [root@linux-node1 zabbix-3.2.7]# yum -y install curl libcurl-devel net-snmp net-snmp-devel perl-DBI libdbi-dbd-mysql mysql-devel gcc gcc++ make libxml2 libxml2-devel java-devel
- [root@linux-node1 zabbix-3.2.7]# ./configure --prefix=/opt/application/zabbix --enable-server --enable-java --enable-proxy --enable-agent --with-net-snmp --with-mysql=/opt/application/mysql/bin/mysql_config --with-libcurl --with-libxml2
- [root@linux-node1 zabbix-3.2.7]# make && make install
- [root@linux-node1 zabbix-3.2.7]# mkdir /opt/application/nginx/html/zabbix/
- [root@linux-node1 zabbix-3.2.7]# cp -r frontends/php/* /opt/application/nginx/html/zabbix/
- [root@linux-node1 zabbix-3.2.7]# l -s /opt/application/zabbix/sbin/* /usr/local/sbin/
- [root@linux-node1 zabbix-3.2.7]# ln -s /opt/application/zabbix/bin/* /usr/local/bin/
- [root@linux-node1 zabbix-3.2.7]# echo "/opt/application/mysql/lib" >> /etc/ld.so.conf
- [root@linux-node1 zabbix-3.2.7]# ldconfig ll
服务配置以及启动
nginx配置与启动
[root@linux-node1 ~]# vim /opt/application/nginx/conf/nginx.conf
server {
listen 8888;
root html/zabbix/;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
[root@linux-node1 ~]# /opt/application/nginx/sbin/nginx
[root@linux-node1 ~]# ps -ef | grep nginx
root 48031 1 0 12:50 ? 00:00:00 nginx: master process /opt/application/nginx/sbin/nginx
nobody 48032 48031 0 12:50 ? 00:00:00 nginx: worker process
root 48140 19734 0 13:20 pts/0 00:00:00 grep --color=auto nginx
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
- x
- [root@linux-node1 ~]# vim /opt/application/nginx/conf/nginx.conf
- server {
- listen 8888;
- root html/zabbix/;
- location ~ \.php$ {
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include fastcgi_params;
- }
- }
- [root@linux-node1 ~]# /opt/application/nginx/sbin/nginx
- [root@linux-node1 ~]# ps -ef | grep nginx
- root 48031 1 0 12:50 ? 00:00:00 nginx: master process /opt/application/nginx/sbin/nginx
- nobody 48032 48031 0 12:50 ? 00:00:00 nginx: worker process
- root 48140 19734 0 13:20 pts/0 00:00:00 grep --color=auto nginx
[root@linux-node1 ~]# mysql -pwoshiniba8
mysql> create database zabbix character set utf8; #创建库
mysql> grant all on zabbix.* to zabbix@'localhost' identified by 'woshiniba8'; # 权限分配
mysql> flush privileges;
mysql> exit
[root@linux-node1 ~]# cd /opt/tools/zabbix-3.2.7/database/mysql/
[root@linux-node1 mysql]# mysql -uzabbix -pwoshiniba8 zabbix < schema.sql
[root@linux-node1 mysql]# mysql -uzabbix -pwoshiniba8 zabbix < images.sql
[root@linux-node1 mysql]# mysql -uzabbix -pwoshiniba8 zabbix < data.sql
- x
- [root@linux-node1 ~]# mysql -pwoshiniba8
- mysql> create database zabbix character set utf8; #创建库
- mysql> grant all on zabbix.* to zabbix@'localhost' identified by 'woshiniba8'; # 权限分配
- mysql> flush privileges;
- mysql> exit
- [root@linux-node1 ~]# cd /opt/tools/zabbix-3.2.7/database/mysql/
- [root@linux-node1 mysql]# mysql -uzabbix -pwoshiniba8 zabbix < schema.sql
- [root@linux-node1 mysql]# mysql -uzabbix -pwoshiniba8 zabbix < images.sql
- [root@linux-node1 mysql]# mysql -uzabbix -pwoshiniba8 zabbix < data.sql
php的配置与启动
[root@linux-node1 ~]# cp /opt/tools/php-5.6.31/php.ini-production /opt/application/php/etc/php.ini
[root@linux-node1 ~]# vim /opt/application/php/etc/php.ini
max_execution_time = 300 (Default is 30)
memory_limit = 128M (no change, default is 128M)
post_max_size = 16M (default is 8M)
upload_max_filesize = 2M (no change, default is 2M)
max_input_time = 300 (default is 60)
date.timezone = Asia/Shanghai (default is empty)
always_populate_raw_post_data = -1
[root@linux-node1 ~]# echo "/opt/web/php/sbin/php-fpm" >> /etc/rc.local
[root@linux-node1 ~]# cp /opt/application/php/etc/php-fpm.conf.default /opt/application/php/etc/php-fpm.conf
[root@linux-node1 ~]# cp /opt/application/php/sbin/php-fpm /etc/init.d/php-fpm
[root@linux-node1 ~]# chmod +x /etc/init.d/php-fpm
[root@linux-node1 ~]# /etc/init.d/php-fpm
[root@linux-node1 ~]# ps -ef | grep php #检测
root 48134 1 0 13:20 ? 00:00:00 php-fpm: master process (/opt/application/php/etc/php-fpm.conf)
nobody 48135 48134 0 13:20 ? 00:00:00 php-fpm: pool www
nobody 48136 48134 0 13:20 ? 00:00:00 php-fpm: pool www
root 48138 19734 0 13:20 pts/0 00:00:00 grep --color=auto php
- x
- [root@linux-node1 ~]# cp /opt/tools/php-5.6.31/php.ini-production /opt/application/php/etc/php.ini
- [root@linux-node1 ~]# vim /opt/application/php/etc/php.ini
- max_execution_time = 300 (Default is 30)
- memory_limit = 128M (no change, default is 128M)
- post_max_size = 16M (default is 8M)
- upload_max_filesize = 2M (no change, default is 2M)
- max_input_time = 300 (default is 60)
- date.timezone = Asia/Shanghai (default is empty)
- always_populate_raw_post_data = -1
- [root@linux-node1 ~]# echo "/opt/web/php/sbin/php-fpm" >> /etc/rc.local
- [root@linux-node1 ~]# cp /opt/application/php/etc/php-fpm.conf.default /opt/application/php/etc/php-fpm.conf
- [root@linux-node1 ~]# cp /opt/application/php/sbin/php-fpm /etc/init.d/php-fpm
- [root@linux-node1 ~]# chmod +x /etc/init.d/php-fpm
- [root@linux-node1 ~]# /etc/init.d/php-fpm
- [root@linux-node1 ~]# ps -ef | grep php #检测
- root 48134 1 0 13:20 ? 00:00:00 php-fpm: master process (/opt/application/php/etc/php-fpm.conf)
- nobody 48135 48134 0 13:20 ? 00:00:00 php-fpm: pool www
- nobody 48136 48134 0 13:20 ? 00:00:00 php-fpm: pool www
- root 48138 19734 0 13:20 pts/0 00:00:00 grep --color=auto php
zabbix-sever配置与启动:
[root@linux-node1 ~]# cd /opt/application/zabbix/etc/
[root@linux-node1 etc]# vim zabbix_server.conf
LogFile=/opt/application/zabbix/logs/zabbix_server.log
PidFile=/tmp/zabbix_server.pid
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=woshiniba8
[root@linux-node1 ~]# mkdir /opt/application/zabbix/logs/
[root@linux-node1 sbin]# chmod 777 /opt/application/zabbix/logs/ -R
[root@linux-node1 ~]# /opt/application/zabbix/sbin/zabbix_server #服务启动
- [root@linux-node1 ~]# cd /opt/application/zabbix/etc/
- [root@linux-node1 etc]# vim zabbix_server.conf
- LogFile=/opt/application/zabbix/logs/zabbix_server.log
- PidFile=/tmp/zabbix_server.pid
- DBHost=localhost
- DBName=zabbix
- DBUser=zabbix
- DBPassword=woshiniba8
- [root@linux-node1 ~]# mkdir /opt/application/zabbix/logs/
- [root@linux-node1 sbin]# chmod 777 /opt/application/zabbix/logs/ -R
- [root@linux-node1 ~]# /opt/application/zabbix/sbin/zabbix_server #服务启动
zabbix-agent配置与启动
[root@linux-node1 ~]# cd /opt/application/zabbix/etc/
[root@linux-node1 etc]# vim zabbix_agentd.conf
LogFile=/opt/application/zabbix/logs/zabbix_agentd.log
Server=127.0.0.1
ServerActive=127.0.0.1
Hostname=Zabbix server
[root@linux-node1 etc]# /opt/application/zabbix/sbin/zabbix_agentd #服务启动
- [root@linux-node1 ~]# cd /opt/application/zabbix/etc/
- [root@linux-node1 etc]# vim zabbix_agentd.conf
- LogFile=/opt/application/zabbix/logs/zabbix_agentd.log
- Server=127.0.0.1
- ServerActive=127.0.0.1
- Hostname=Zabbix server
- [root@linux-node1 etc]# /opt/application/zabbix/sbin/zabbix_agentd #服务启动
web界面登录配置
- 配置检查
- 连接数据库
- server详细信息
- 继续下一步
- 安装
- 登录
- darshboard
zabbix客户端安装
客户端准备环境
- OS:CentOS Linux release 7.3.1611 (Core)
- hostname:linux-node2
- IP:192.168.56.12
- zabbix:https://jaist.dl.sourceforge.net/project/zabbix/ZABBIX Latest Stable/3.2.7/zabbix-3.2.7.tar.gz
[root@linux-node2 ~]# yum -y install gcc gcc-devel c++
[root@linux-node2 ~]# mkdir /opt/{application,tools}
[root@linux-node2 tools]# wget http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.rpm?AuthParam=1504418803_96caf675c8af37c08b7a8890c20e0ec8
[root@linux-node2 tools]# rpm -ivh jdk-8u144-linux-x64.rpm
[root@linux-node2 tools]# wget https://jaist.dl.sourceforge.net/project/zabbix/ZABBIX Latest Stable/3.2.7/zabbix-3.2.7.tar.gz
[root@linux-node1 tools]# useradd -s /sbin/nologin zabbix
- [root@linux-node2 ~]# yum -y install gcc gcc-devel c++
- [root@linux-node2 ~]# mkdir /opt/{application,tools}
- [root@linux-node2 tools]# wget http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.rpm?AuthParam=1504418803_96caf675c8af37c08b7a8890c20e0ec8
- [root@linux-node2 tools]# rpm -ivh jdk-8u144-linux-x64.rpm
- [root@linux-node2 tools]# wget https://jaist.dl.sourceforge.net/project/zabbix/ZABBIX Latest Stable/3.2.7/zabbix-3.2.7.tar.gz
- [root@linux-node1 tools]# useradd -s /sbin/nologin zabbix
客户端安装
[root@linux-node2 ~]# cd /opt/tools/
[root@linux-node2 tools]# tar xf zabbix-3.2.7.tar.gz
[root@linux-node2 zabbix-3.2.7]# ./configure --prefix=/opt/application/zabbix-agent --enable-agent --enable-java
[root@linux-node2 zabbix-3.2.7]# make && make install
- x
- [root@linux-node2 ~]# cd /opt/tools/
- [root@linux-node2 tools]# tar xf zabbix-3.2.7.tar.gz
- [root@linux-node2 zabbix-3.2.7]# ./configure --prefix=/opt/application/zabbix-agent --enable-agent --enable-java
- [root@linux-node2 zabbix-3.2.7]# make && make install
[root@linux-node2 ~]# cd /opt/application/zabbix-agent/etc/
[root@linux-node2 etc]# vim zabbix_agentd.conf
LogFile=/opt/application/zabbix-agent/logs/zabbix_agentd.log
Server=192.168.56.11
Hostname=Zabbix server
[root@linux-node2 etc]# mkdir /opt/application/zabbix-agent/logs
[root@linux-node2 etc]# chmod 777 -R /opt/application/zabbix-agent/logs
[root@linux-node2 etc]# groupadd zabbix
[root@linux-node2 etc]# useradd -g zabbix -s /sbin/nologin -M zabbix
[root@linux-node2 etc]# /opt/application/zabbix-agent/sbin/zabbix_agentd
- [root@linux-node2 ~]# cd /opt/application/zabbix-agent/etc/
- [root@linux-node2 etc]# vim zabbix_agentd.conf
- LogFile=/opt/application/zabbix-agent/logs/zabbix_agentd.log
- Server=192.168.56.11
- Hostname=Zabbix server
- [root@linux-node2 etc]# mkdir /opt/application/zabbix-agent/logs
- [root@linux-node2 etc]# chmod 777 -R /opt/application/zabbix-agent/logs
- [root@linux-node2 etc]# groupadd zabbix
- [root@linux-node2 etc]# useradd -g zabbix -s /sbin/nologin -M zabbix
- [root@linux-node2 etc]# /opt/application/zabbix-agent/sbin/zabbix_agentd
添加第一台监控主机
- 登录zabbix-darshboard
- 添加主机
- 主机信息填写
- 配置模板
zabbix源码编译安装以及添加第一台host监控的更多相关文章
- Zabbix 源码编译安装
简介: Zabbix 分布式监控系统,源码编译安装记录 ( 记不得是第多少次了 ) 下载地址:http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX ...
- nginx在centos 7中源码编译安装【添加grpc的支持】
安装依赖软件 1.安装编译工具gcc gcc是一个开源编译器集合,用于处理各种各样的语言:C.C++.Java.Ada等,在linux世界中是最通用的编译器,支持大量处理器:x86.AMD64.Pow ...
- 保姆级教程——Ubuntu16.04 Server下深度学习环境搭建:安装CUDA8.0,cuDNN6.0,Bazel0.5.4,源码编译安装TensorFlow1.4.0(GPU版)
写在前面 本文叙述了在Ubuntu16.04 Server下安装CUDA8.0,cuDNN6.0以及源码编译安装TensorFlow1.4.0(GPU版)的亲身经历,包括遇到的问题及解决办法,也有一些 ...
- zstack源码编译安装(1.7.x版本)
图片没粘贴过来,请看本人gitbook吧https://www.gitbook.com/book/jingtyu/how-to-learn-zstack-code 运行环境 zstack的安装方式有很 ...
- ambari 2.5.0源码编译安装
参考:https://www.ibm.com/developerworks/cn/opensource/os-cn-bigdata-ambari/index.html Ambari 是什么 Ambar ...
- 源码编译安装MySQL8.0.20
1 概述 本文章主要讲述了如何从源码编译安装MySQL社区版8.0.20,首先会介绍一些编译安装的相关知识,然后开始编译安装 2 源码编译安装的相关知识 2.1 make与configure make ...
- LAMP架构—源码编译安装 (爱情受过伤,为爱跳过鸭绿江)
LAMP架构--源码编译安装 1.LAMP架构概述 2.编译安装Apache httpd 服务 3.编译安装mysql 服务 4.编译安装PHP 解析服务 5.利用LAMP搭建论坛 1.LAMP架构概 ...
- Centos7.X 源码编译安装subversion svn1.8.x
说明:SVN(subversion)的运行方式有两种:一种是基于Apache的http.https网页访问形式:还有一种是基于svnserve的独立服务器模式.SVN的数据存储方式也有两种:一种是在B ...
- centos6.5环境源码编译安装mysql5.6.34
centos6.5环境源码编译安装mysql5.6.34 源码下载地址http://dev.mysql.com/downloads/mysql/5.6.html#downloads 选择Generic ...
随机推荐
- Python - 基本数据类型及其常用的方法之字典和布尔值
字典 特点:{"key1": value1, "key2":value2} , 键值对中的值可以为任何数据类型,键不能为列表.字典(无法哈希),布尔值可以为键 ...
- 修改CentOS6.5主机名引起MySQL5.6.35服务问题
本来是心血来潮修改CentOS6.5的主机名 /****** 修改CentOS6.5默认主机名 ******/ .备份系统网络配置文件 [root@localhost ~]# cp /etc/sysc ...
- Python模块安装方式
一.方法1: 单文件模块直接把文件拷贝到 $python_dir/lib/python3.4/site-packages/ 二.方法2: 多文件模块,带setup.py 下载模块包,进行解压,进入模块 ...
- LA3029 City Game
Bob is a strategy game programming specialist. In his new city building game the gaming environment ...
- 用惯了jquery, 想用angularjs 还真不好理解
jquery 比较直白,什么都是操作dom 节点. angularjs 就好比 thinkphp, ci 等框架,有自己约定的格式和方式.需要遵循它的规则,研究中... 比如说我,用了很长事件的jqu ...
- Spring.Net2.0+NHibernate4.0 +Asp.Net Mvc4 一
1.创建项目结构 控制器: SN.Controllers 数据访问 :SN.Dao 实体映射: SN.Models 服务层: SN.Servers 视图层: SN.Web 2.添加需 ...
- 2018-8-10-如何移动-nuget-缓存文件夹
title author date CreateTime categories 如何移动 nuget 缓存文件夹 lindexi 2018-08-10 19:16:51 +0800 2018-2-13 ...
- 一个基于swoole的作业调度组件,已经实现了redis和rabitmq队列消息存储。
https://github.com/kcloze/swoole-jobs 一个基于swoole的作业调度组件,已经实现了redis和rabitmq队列消息存储.参考资料:swoole https:/ ...
- ubuntu设置终端命令历史记录
----------------------------------------------- HISTTIMEFORMAT='%F %T ' # 使用HISTTIMEFORMAT在历史中显示TIME ...
- 模拟4题解 T3奇袭
T3奇袭 题目描述 由于各种原因,桐人现在被困在Under World(以下简称UW)中,而UW马上 要迎来最终的压力测试——魔界入侵. 唯一一个神一般存在的Administrator被消灭了,靠原本 ...