##################################################
在RedHat Linux as5上安装Zabbix 1.8软件---安装手册
2011-02-21
##################################################
1.       安装前准备
主机信息配置:
O/S: Redhat Linux AS5.5 I386bit
需要软件包:
Redhat Linux AS 5.5 RPM包(Servers
zabbix-1.8.4.tar.gz
 
2.  操作系统设置
 
1) 计算机名称修改
2) 网络设置(静态IP地址,DNS,时间同步)
 
3.  LAMP安装
       LAMPLinux+Apache+Mysql+PHP环境搭建包
rpm -ivh httpd-2.2.3-11.el5.i386.rpm 
rpm -ivh apr-devel-1.2.7-11.i386.rpm 
rpm -ivh apr-util-devel-1.2.7-6.i386.rpm 
rpm -ivh httpd-devel-2.2.3-11.el5.i386.rpm 
rpm -ivh perl-5.8.8-10.i386.rpm 
rpm -ivh perl-DBI-1.52-1.fc6.i386.rpm 
rpm -ivh mysql-5.0.22-2.1.0.1.i386.rpm 
rpm -ivh php-5.1.6-15.el5.i386.rpm 
rpm -ivh php-pdo-5.1.6-15.el5.i386.rpm 
rpm -ivh php-mysql-5.1.6-15.el5.i386.rpm 
rpm -ivh mysql-bench-5.0.22-2.1.0.1.i386.rpm 
rpm -ivh mysql-devel-5.0.22-2.1.0.1.i386.rpm 
rpm -ivh mysql-server-5.0.22-2.1.0.1.i386.rpm 
rpm -ivh perl-DBD-MySQL-3.0007-1.fc6.i386.rpm
rpm -ivh php-mbstring-5.1.6-27.el5.i386.rpm
 
4. 依赖软件包安装
rpm -ivh lm_sensors-2.10.7-9.el5.i386.rpm
rpm -ivh lm_sensors-devel-2.10.0-3.1.i386.rpm
rpm -ivh net-snmp-5.3.1-19.el5.i386.rpm
rpm -ivh beecrypt-4.1.2-10.1.1.i386.rpm
rpm -ivh beecrypt-devel-4.1.2-10.1.1.i386.rpm 
rpm -ivh elfutils-libs-0.137-3.el5.i386.rpm
rpm -ivh elfutils-devel-0.125-3.el5.i386.rpm 
rpm -ivh elfutils-devel-static-0.125-3.el5.i386.rpm 
rpm -ivh net-snmp-devel-5.3.1-19.el5.i386.rpm 
rpm -ivh net-snmp-perl-5.3.1-19.el5.i386.rpm
rpm -ivh net-snmp-utils-5.3.1-19.el5.i386.rpm
rpm -ivh php-snmp-5.1.6-15.el5.i386.rpm
rpm -ivh net-snmp-devel-5.3.1-19.el5.i386.rpm
rpm -ivh php-bcmath-5.1.6-15.el5.i386.rpm
rpm -ivh php-gd-5.1.6-15.el5.i386.rpm
rpm -ivh curl-devel-7.15.5-2.el5.i386.rpm
rpm –ivh gcc-4.1.2-48.el5.rpm
//需使用LDAP用户认证
rpm –ivh php-ldap-5.1.6-27.el5.rpm
rpm –ivh openldap-2.3.43-12.el5.i386.rpm
rpm –ivh openldap-clients-2.3.43-12.el5.i386.rpm
rpm –ivh openldap-devel-2.3.43-12.el5.i386.rpm
 
5. 软件编译及相关设置
解压安装包
#tar zxvf zabbix-1.8.4.tar.gz
 
增加zabbix用户和组
#groupadd zabbix
#useradd –g zabbix –m zabbix
     
Zabbix安装包编译
      #./configure --prefix=/opt/zabbix--enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl--with-ldap --with-OpenIPMI
      Zabbix 安装
      #make
      #make install
6. 数据库的设置
      登入Mysql数据库
#mysql –u root –p
     
创建Zabbix数据库
     Mysql> create database zabbix character set utf8;
 
      导入数据库sql脚本
# cd create/schema
# cat mysql.sql | mysql -u<username> -p<password> zabbix
# cd ../data
# cat data.sql | mysql -u<username> -p<password> zabbix
# cat images_mysql.sql | mysql -u<username> -p<password> zabbix
 
7. 配置文件的相关设置
     
添加配置文件
      # mkdir -p /etc/zabbix
# cp ./misc/conf/* /etc/zabbix
# chown -R zabbix:zabbix /etc/zabbix
     
      拷贝前端数据
# cd frontends/
# cp -rf php /var/www/html/
# cd /var/www/html
# mv php zabbix
# chown -R zabbix:zabbix zabbix
     
拷贝启动执行配置文件
cp ./misc/init.d/redhat/zabbix_* /etc/init.d/
 
      修改配置文件
           修改PHP.INI
# vi /etc/php.ini    找到如下几项,改成下面的值,前面有;号的要删掉
max_execution_time = 300
date.timezone = Asia/Shanghai
post_max_size = 32M
memory_limit = 128M
mbstring.func_overload = 2
修改services文件
# 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
           修改zabbix_server.conf配置文件
                 vi /etc/zabbix/zabbix_server.conf
ListenPort=10051  
DBHost=localhost   
DBName=zabbix   
DBUser=root   
DBPassword=   
DBSocket=/var/lib/mysql/mysql.sock #默认安装Localmysql
修改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
8. 前端配置
      修改 httpd.conf
      # vi /etc/httpd/conf/httpd.conf
DocumentRoot "/var/www/html/zabbix"
      重启Apache
      前端网页设置
      浏览器中输入http://172.18.9.162 ,进入相关设置
1)         检查配置要求
2)         数据库设置(此处采用本地Mysql
3)  继续直到完成
4用户admin 密码zabbix 登入配置相关信息
9.   服务器启动设置
开机启动
# echo '/etc/init.d/zabbix_server_ctl start &' >>/etc/rc
# echo '/etc/init.d/zabbix_agentd_ctl start &' >>/etc/rc
 
启动ServerAgentd(可以通过start stop restart来操作)
# zabbix_agentd_ctl start
# zabbix_server_ctl start
10. 设置
Auto Discovery 设置
Configuration> Actions>Discovery(Selected Enabled)
 

本文出自 “梦幻舞步-DanceDream” 博客,请务必保留此出处http://ze1911.blog.51cto.com/287819/730726