zabbix是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案。zabbix能监视各种网络参数,保证服务器系统的安全运营;并提供柔软的通知机制以让系统管理员快速定位/解决存在的各种问题。

测试环境:centos6.4+zabbix2.2

一、安装lamp(server端)

# yum -y install httpd mysql mysql-serverphp

    二、编译安装zabbix2.2(server端)

准备编译环境:

#yum -y install gcc gcc-c++ autoconf make cmake openssl openssl-develncurses-devel libxml2-devel zlib-devel php-mysql php-gd curl curl-develnet-snmp net-snmp-devel perl-DBI php-xml mysql-devel php-bcmath php-mbstring

创建zabbix数据库并授权用户访问

#service mysqld start

mysql>create database zabbix character set utf8;

mysql>grant all on zabbix.* to zabbix@"%" identified by "zabbix";

mysql>flush privileges;

#tar xf zabbix-2.2.2.tar.gz

#cd zabbix-2.2.2

初始化zabbix数据库

#mysql -uzabbix -h192.168.1.3 -pzabbix zabbix < database/mysql/schema.sql

#mysql -uzabbix -h192.168.1.3 -pzabbix zabbix < database/mysql/p_w_picpaths.sql

#mysql -uzabbix -h192.168.1.3 -pzabbix zabbix < database/mysql/data.sql

# ./configure--prefix=/usr/local/zabbix --enable-server --with-net-snmp --with-libcurl--with-mysql=/usr/bin/mysql_config

#make && make install

#useradd -r zabbix -s /sbin/nologin

#cp misc/init.d/tru64/zabbix_server /etc/init.d/(这里需要修改下脚本的命令路径)

#cp -r frontends/php /var/www/html/zabbix

修改php.ini相关选项

date.timezone =Asia/Shanghai

post_max_size = 50M

max_execution_time = 300

max_input_time = 300

启动zabbix_server、httpd服务

# service zabbix_server start

# service httpd start

打开浏览器,输入http://zabbix_server_ip/zabbix

wKiom1VGxaqgry-FAAExHdgkHss101.jpg

wKiom1VGxdPyDKuDAAHLPxQJW-4718.jpg

wKiom1VGxfeQPAWkAAFzxdoLyUE894.jpg

wKiom1VGxhmxXXSrAAEwPn9cBtg379.jpg

wKioL1VGx7ygdgUfAAF4IrIBTJw902.jpg

wKiom1VGxk7wYEqKAAESIiz3Xts261.jpg

wKioL1VGx_Dw3LCeAADtS9CGnrI426.jpg

默认的用户名是admin,密码是zabbix,至此,zabbix服务端编译安装完成

三、编译安装zabbix2.2agent端)


准备编译安装环境


# yum -y install gcc gcc-c++ autoconf make cmake openssl openssl-devel ncurses-devel libxml2-devel zlib-devel php-mysql php-gd curl curl-devel net-snmp net-snmp-devel perl-DBI php-xml mysql-devel php-bcmath php-mbstring


# useradd -r -s /sbin/nologin zabbix


# tar xf zabbix-2.2.2.tar.gz


# cd zabbix-2.2.2


# ./configure --prefix=/usr/local/zabbix --enable-agent --with-net-snmp --with-libcurl


# make && make install


# cp misc/init.d/tru64/zabbix_agentd /etc/init.d/


# chmod +x /etc/init.d/zabbix_agentd

   zabbix客户端编译安装完成。