Chinaunix首页 | 论坛 | 博客
  • 博客访问: 246405
  • 博文数量: 79
  • 博客积分: 1942
  • 博客等级: 上尉
  • 技术积分: 910
  • 用 户 组: 普通用户
  • 注册时间: 2008-05-19 16:17
文章分类

全部博文(79)

文章存档

2011年(1)

2010年(50)

2009年(28)

分类: LINUX

2009-09-04 10:36:49

zabbix 1.6.6 安装配置步骤
 
环境:CentOS5.2
 
一、LAMP环境搭建(以下是我安装的包)
前提是保证LAMP已经正常运行(yum install httpd mysql mysql-server php perl)
另外需先安装下面的软件包
最好用yum来安装,自动解决软件包之间的依赖关系
mysql-devel
net-snmp-devel
curl-devel
perl-DBI
php-gd
php-mysql
php-bcmath
 
二、数据库及其相关表的建立
-bash-3.1# wget
-bash-3.1# tar zvxf zabbix-1.6.6.tar.gz
-bash-3.1# cd zabbix-1.6.6
-bash-3.1# mysql -u root -p
mysql> create database zabbix;
mysql>quit;
-bash-3.1# cd create/schema/
-bash-3.1# cat mysql.sql | mysql -u root -p zabbix
-bash-3.1# cd ../data/
-bash-3.1# cat data.sql | mysql -u root -p zabbix
-bash-3.1# cat images_mysql.sql | mysql -u root -p zabbix
三、编译安装zabbix
服务器端的编译
-bash-3.1#  ./configure --with-mysql --with-net-snmp --with-libcurl --enable-server --enable-agent --enable-proxy
--prefix=/usr/local/zabbix
客户端的编译
./configure --prefix=/usr/local/zabbix --enable-agent
-bash-3.1# make 
-bash-3.1# make install
-bash-3.1# vi /etc/services
添加
zabbix-agent    10050/tcp Zabbix Agent
zabbix-agent    10050/udp Zabbix Agent
zabbix-trapper  10051/tcp Zabbix Trapper
zabbix-trapper  10051/udp Zabbix Trapper

四、拷贝一些文件以及修改一些文件
-bash-3.1# mkdir /etc/zabbix
-bash-3.1# cp misc/conf/* /etc/zabbix/
-bash-3.1# cd frontends/
-bash-3.1# cp -a php /var/www/html/
-bash-3.1# cd /var/www/html/
-bash-3.1# mv php zabbix
-bash-3.1# chown zabbix:zabbix -R zabbix/
-bash-3.1# cd /var/www/html/zabbix/include
-bash-3.1# vi db.inc.php
添加如下内容,同时还要修改/var/www/html/zabbix/include/setup.inc.php同样加入下面的内容
$DB_TYPE="MYSQL";
$DB_SERVER="localhost";
$DB_DATABASE="zabbix";
$DB_USER="root";
$DB_PWD="";
-bash-3.1# vi /etc/php.ini
找到max_execution_time = 30
改成max_execution_time = 300
找到 ;date.timezone =
改成date.timezone = Asia/Shanghai
对配置文件做一下修改,配置文件为:
-bash-3.1# vi /etc/zabbix/zabbix_server.conf    
-bash-3.1# vi /etc/zabbix/zabbix_agentd.conf
这两个文件可以看里面的说明来修改 

复制启动程序
-bash-3.1# cp misc/init.d/redhat/zabbix_server_ctl  /etc/init.d/
-bash-3.1# cp misc/init.d/redhat/zabbix_agentd_ctl /etc/init.d/
修改启动程序参数 
-bash-3.1# vi /etc/init.d/zabbix_server_ctl    
# base zabbix dir  
BASEDIR=/usr/local/zabbix  
# PID file  
PIDFILE=/var/tmp/zabbix_server.pid  
# binary file  
ZABBIX_SUCKERD=$BASEDIR/sbin/zabbix_server
-bash-3.1# vi /etc/init.d/zabbix_agentd_ctl
# base zabbix dir
BASEDIR=/usr/local/zabbix
# pid file (as of 1.0 beta 10)
PIDFILE=/var/tmp/zabbix_agentd.pid
# binary file
ZABBIX_AGENTD=$BASEDIR/sbin/zabbix_agentd

配置文件
-bash-3.1# mkdir /etc/zabbix
-bash-3.1# chown -R zabbix.zabbix /etc/zabbix/
-bash-3.1# cp misc/conf/zabbix_* /etc/zabbix/

关闭启动的相关命令是:
-bash-3.1# /etc/init.d/zabbix_server_ctl start|stop|restart
-bash-3.1# /etc/init.d/zabbix_agentd_ctl start|stop|restart

安装自启动服务
-bash-3.1# chkconfig --add zabbix-server
-bash-3.1# chkconfig --add zabbix-agent
-bash-3.1# chkconfig zabbix-server on
-bash-3.1# chkconfig zabbix-agent on

复制zabbix网页文件到apacheroot目录
-bash-3.1# mkdir /var/www/html/zabbix
-bash-3.1# cp -Rpf frontends/php/* /var/www/html/zabbix

下面开启服务端以及客户端:
-bash-3.1# /etc/init.d/zabbix_server_ctl start
-bash-3.1# /etc/init.d/zabbix_agentd_ctl start

五、登录
有问题或者Fail请看页面上的提示,很简单就能解决
默认登录用户名admin密码zabbix
 
阅读(1292) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~