232312 发表于 2014-7-15 14:03:44

zabbix2.2安装配置(1)

1、安装LAMP环境,并安装依赖包。

1
2
3
4
# yum -y install httpd php mysql-server
# yum -y install mysql-devel gcc net-snmp-devel crul-devel libxml2-devel perl-DBI php-gd php-mysql php-bcmath php-mbstring php-xml
# chkconfig httpd on
# chkconfig mysqld on




2、添加用户,创建数据库,添加授权账户

1
2
3
4
5
# useradd zabbix
# mysqladmin -u root -h localhost password "password"
# mysql -uroot -p
mysql> create database zabbix character set utf8;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'password';




3、编译安装zabbix,下载地址:http://www.zabbix.com/download.php


1
2
3
4
# tar -zxvf zabbix-2.2.4.tar.gz
# cd zabbix-2.2.4
# ./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --with-net-snmp --with-liburl --with-libxml2
# make install




4、导入数据库。

1
2
3
# mysql -uzabbix -pzabbix -hlocalhost zabbix < database/mysql/schema.sql
# mysql -uzabbix -pzabbix -hlocalhost zabbix < database/mysql/images.sql
# mysql -uzabbix -pzabbix -hlocalhost zabbix < database/mysql/data.sql




5、修改配置文件,添加服务端口,启动服务。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# cp misc/init.d/fedora/core/zabbix_server /etc/init.d/
# cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/
# cp -R frontends/php /var/www/html/zabbix
# vim /usr/local/zabbix/etc/zabbix_server.conf
DBUser=zabbix
DBPassword=zabbix
# vim /etc/init.d/zabbix_server
BASEDIR=/usr/local/zabbix
# vim /etc/init.d/zabbix_agentd
BASEDIR=/usr/local/zabbix
# vim /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
# /etc/init.d/zabbix_server start
# /etc/init.d/zabbix_agentd start
# echo "/etc/init.d/zabbix_server start" >> /etc/rc.local
# echo "/etc/init.d/zabbix_agentd start" >> /etc/rc.local




6、web登录:http://ip/zabbix
如有fail需要完善系统要求



1
2
3
4
5
6
# vim /etc/php.ini
post_max_size = 30M
max_execution_time = 300
max_input_time = 300
date.timezone = Asia/Shanghai
# service httpd restart




然后重新检测








页: [1]
查看完整版本: zabbix2.2安装配置(1)