服务端安装:
1. yum install mysql-dev gcc net-snmp-devel curl-devel perl-DBI php-gd php-mysql php-bcmath php-mbstring php-xm libtool* gcc-c++ libxml2 libxslt-devel -y
2. 安装nginx
1. tar zxpf pcre-8.12.tar.gz && cd pcre-8.12 && ./configure && make && make install
2. tar zxpf nginx_upstream_jvm_route
3. cd nginx-1.0.15 && patch -p0 <../nginx_upstream_jvm_route/jvm_route.patch
4. ./configure --user=root --group=root --prefix=/usr/local/webserver/nginx --with-pcre=/usr/local/webserver/pcre-8.12 --with-http_stub_status_module --with-http_flv_module --with-http_ssl_module --with-http_dav_module --with-http_gzip_static_module --with-mail --with-mail_ssl_module --with-http_realip_module --with-http_xslt_module --with-sha1=/usr/include/openssl --with-md5=/usr/include/openssl --add-module=/usr/local/webserver/nginx_upstream_jvm_route && make && make install
3. 安装php
1. yum install gcc make gd-devel libjpeg-devel libpng-devel libxml2-devel bzip2-devel libcurl-devel -y
2. tar zpxf php-5.5.28.tar.gz && cd php-5.5.28
3. ./configure --prefix=/usr/local/webserver/php-5.5.7 --with-config-file-path=/usr/local/webserver/php-5.5.7/etc --with-bz2 --with-curl --enable-ftp --enable-sockets --disable-ipv6 --with-gd --with-jpeg-dir=/usr/local/webserver --with-png-dir=/usr/local/webserver --with-freetype-dir=/usr/local/webserver --enable-gd-native-ttf --with-iconv-dir=/usr/local/webserver --enable-mbstring --enable-calendar --with-gettext --with-libxml-dir=/usr/local/webserver --with-zlib --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-mysql=mysqlnd --enable-dom --enable-xml --enable-fpm --with-libdir=lib64 --enable-bcmath && make && make install
4. 安装数据库
1. yum install mysql mysql-devel mysql-server
5. 安装zabbix
1. yum install net-snmp-devel libxml2-devel libcurl-devel // 一定先安装依赖
cd /usr/local/src
wget "http://downloads.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.2/zabbix-2.2.2.tar.gz?r=http%3A%2F%2Fwww.zabbix.com%2Fdownload.php&ts=1395066528&use_mirror=jaist"
tar -xzvf zabbix-2.2.2.tar.gz
cd zabbix-2.2.2
./configure --prefix=/usr/local/zabbix-2.2.2/ --enable-server \
--enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2
make
make install
6. 添加用户
1. groupadd zabbix
useradd -g zabbix zabbi
7. 初始化数据库:
1. mysql -uroot
2、 mysql> create database zabbix default charset utf8;
mysql> quit;
3. mysql zabbix < database/mysql/schema.sql
mysql zabbix < database/mysql/images.sql
mysql zabbix < database/mysql/data.sql
8. 启动zabbix
1. /usr/local/zabbix-2.2.2/sbin/zabbix_server
客户端安装:
1. cd /usr/local/src
wget "http://downloads.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.2/zabbix-2.2.2.tar.gz?r=http%3A%2F%2Fwww.zabbix.com%2Fdownload.php&ts=1395066528&use_mirror=jaist"
tar -xzvf zabbix-2.2.2.tar.gz
cd zabbix-2.2.2
./configure --prefix=/usr/local/zabbix-2.2.2/ --enable-agent
make
make install
2. vim /usr/local/zabbix-2.2.2/etc/zabbix_agentd.conf
Server=127.0.0.1 Server和ServerActive都指定zabbixserver的IP地址
ServerActive=127.0.0.1
Hostname=Zabbix server
3. 客户端启动
/usr/local/zabbix-2.2.2/sbin/zabbix_agent
拷贝前端文件 (zabbix 服务端)
cd /usr/local/src
mkdir /data/logs/nginx
mkdir /data/site/monitor.ttlsa.com/zabbix
cp -rp frontends/php/* /data/site/monitor.ttlsa.com/zabbix
修改nginx配置文件():
vim /usr/local/webserver/nginx/conf/vhost/monitor.ttlsa.com.conf
server {
listen 80;
server_name monitor.ttlsa.com;
access_log /data/logs/nginx/monitor.ttlsa.com.access.log main;
index index.html index.php index.html;
root /data/site/monitor.ttlsa.com;
location /
{
try_files $uri $uri/ /index.php?$args;
}
location ~ ^(.+.php)(.*)$ {
fastcgi_split_path_info ^(.+.php)(.*)$;
include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
在线配置zabbix
浏览器打开http://monitor.ttlsa.com/zabbix
用户名 Admin 密码 zabbix