Centos zabbix 编译安装

1. 安装依赖包:

Yum �Cy install gcc gcc-c++ autoconf httpd php mysql mysql-server php-mysql httpd-manual mod_ssl mod_perl mod_auth_mysql php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-bcmath mysql-connector-odbc mysql-devel libdbi-dbd-mysql net-snmp-devel curl-devel unix-ODBC-devl OpenIPMI-devel java-devel

clip_image002

2. 配置PHP所需环境

Vim /etc/php.ini

date.timezone = Asia/Shanghai

max_execution_time = 300

post_max_size = 32M

max_input_time = 300

memory_limit = 128M

mbstring.func_overload = 2

3下载安装Zbbix-Server

wget http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/2.2.2/zabbix-2.2.2.tar.gz -P /root

增加zabbix用户

groupadd zabbix

useradd �Cg zabbix �Cm zabbix

tar zxf zabbix-2.2.2-tar.gz �CC /usr/src

cd /usr/src/zabbix-2.2.2

./configure --prefix=/usr/local/zabbix --sysconfir=/etc/zabbix �Cenable-server �Cenable-proxy �Cenable-agent �Cenable-ipv6 �Cwith-mysql=/usr/bin/msyql_config �Cwith-net-snmp �Cwith-libcurl �Cwith-openipmi �Cwith-unixodbc �Cwith-ldap �Cwith-ssh2 �Cenable-java

clip_image004

clip_image005

安装yum install php-pecl-ssh2 libssh2-devel

clip_image007

安装 :
yum install openldap openldap-devel

编译安装:

make && make install

3. 开户数据库

service mysqld start

chkconfig mysqld on

4. 创建zabbix 数据库

mysql �Cu root

create database zabbix ;

grant all on zabbix.* to zabbix@localhsot identified by ‘zabbix’;

导入zabbix-server的数据库

clip_image008

cd /usr/src/zabbix-2.2.2/database/mysql

mysql �Cu zabbix �Cp zabbix < schema.sql

注意:如果是安装proxy,只导入SCHEMA.SQL就好,无须导入下面的SQL,否则proxy无法工作

mysql �Cu zabbix �Cp zabbix < images.sql

mysql �Cu zabbix �Cp zabbix < data.sql

或者在数据库里这样导入:source /usr/src/zabbix-2.2.2/database/mysql/schema.sql

5. 复制Service 启动脚本

clip_image009

cp /usr/src/zabbix-2.2.2/misc/init.d/fedora/core/zabbix_server /etc/init.d/

chmod +x /etc/init.d/zabbix_server

并修改/etc/init.d/zabbix_server

BASEDIR=/usr/local 改为:/usr/local/zabbix

6. 配置zabbix_server.conf

DBUser=zabbix

DBName=zabbix

DBPassword=zabbix

7. 复制网页文件到/var/www/html 下

clip_image010

cp -r /usr/src/zabbix-2.2.2/frontends/php/ /var/www/html/zabbix

chown �CR apache.apache /var/www/html/zabbix

8. 开启zabbix服务

chkconfig zabbix_server on

service zabbix_server start

service httpd start

chkconfig httpd on

9. 访问http://ip/zabbix

clip_image012

点击 next

clip_image013

vim /etc/php.ini

搜索date.timezone =

修改:date.timezone=Asia/Shanghai

clip_image015

测试连接:

clip_image017

输入名字:

clip_image019

OK,finish

clip_image021

登录:默认用户名admin 密码:zabbix

clip_image023

clip_image025

到此,zabbix-server 安装完成。

注:防火墙,selinux。

1. 可以直接关闭防火墙和selinux

service iptables stop

vim /etc/selinux/config SELINUX=disable

2或者设置策略

iptables �CA INPUT �Cm state �Cstate NEW �Cm tcp �Cp tcp �Cdport 22 �Cj ACCEPT

iptables �CA INPUT �Cm state �Cstate NEW �Cm tcp �Cp tcp �Cdport 80 �Cj ACCEPT

iptables �CA INPUT �Cm state �Cstate NEW �Cm tcp �Cp tcp �Cdport 10051 �Cj ACCEPT

iptables �CA OUTPUT �Cm state �Cstate NEW �Cm tcp �Cp tcp �Cdport 10050 �Cj ACCEPT

iptables �CA INPUT �Cm state �Cstate NEW �Cm tcp �Cp tcp �Cdport 10050 �Cj ACCEPT

你可能感兴趣的:(mysql,target,blank)