##################################################
在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
安装
LAMP
(
Linux+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 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 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 p_w_picpaths_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 #
默认安装
Local
的
mysql
修改
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
启动
Server
和
Agentd(
可以通过
start stop restart
来操作
)
# zabbix_agentd_ctl start
# zabbix_server_ctl start
10.
设置
Auto Discovery
设置
Configuration
—
> Actions
—
>Discovery(Selected Enabled)
转载于:https://blog.51cto.com/ze1911/730726