1、安装zabbix官方epel包

 rpm -ivh http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-release-2.2-1.el6.noarch.rpm
http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm

2、安装zabbix

yum install zabbix-server-mysql zabbix-web-mysql -y

3、安装MySQL并启动服务

yum install mysql mysql-devel mysql-server -y
service mysqld restart

4、安装zabbix agent

yum install zabbix-agent -y

5、创建zabbix mysql数据库

mysql -uroot -p
 
mysql> create database zabbix;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
mysql> flush privileges;

6、导入数据库和表

cd /usr/share/doc/zabbix-server-mysql-2.2.12/create
mysql -uroot zabbix < schema.sql   //创建表结构
mysql -uroot zabbix < images.sql   //导入相关图片
mysql -uroot zabbix < data.sql    // 基础的初始化数据

7、编辑zabbix数据配置

vi /etc/zabbix/zabbix_server.conf 
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix

8、开启zabbix-server进程

/etc/zabbix/zabbix_server start   //开启zabbix-server服务

9、修改php配置文件

vi /etc/httpd/conf.d/zabbix.conf
    <IfModule mod_php5.c>
        php_value max_execution_time 300
        php_value memory_limit 128M
        php_value post_max_size 16M
        php_value upload_max_filesize 2M
        php_value max_input_time 300
        php_value date.timezone Asia/Shanghai  //去掉注释,修改时间
    </IfModule>

#########这里的date.timezone时间必须是正确的#########

10、重启http服务

/etc/init.d/httpd restart

11、关闭Selinux开启防火墙端口

setenforce 0   //临时关闭
iptables -I INPUT -p tcp --dport 80 -j ACCEPT
iptables -I INPUT -p tco --dport 3306 -j ACCEPT
iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
iptables -I INPUT -p tcp --dport 10050:10051 -j ACCEPT
service iptables save


查看iptables
[root@localhost create]# iptables -L -n --line 
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination         
1    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpts:10050:10051           
### //zabbix端口为10050/10051 可以通过netstat -antp | grep zabbix 查看 ### 2 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:3306 3 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
4 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED 5 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 6 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 7 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22 8 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited Chain FORWARD (policy ACCEPT) num target prot opt source destination 1 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited Chain OUTPUT (policy ACCEPT) num target prot opt source destination

 

12、打开浏览器完成安装zabbix

http://172.17.0.8/zabbix     //ip+zabbix

#########zabbix安装完成后默认User:admin Password:zabbix#########

13、修改配置文件,汉化zabbix

vi /usr/share/zabbix/include/locales.inc.php
function getLocales() {
        return array(
                'en_GB' => array('name' => _('English (en_GB)'),        'display' => true),
                'en_US' => array('name' => _('English (en_US)'),        'display' => true),
                'bg_BG' => array('name' => _('Bulgarian (bg_BG)'),      'display' => false),
                'zh_CN' => array('name' => _('Chinese (zh_CN)'),        'display' => true),           //只需将这里false改为true即可
                'zh_TW' => array('name' => _('Chinese (zh_TW)'),        'display' => false),

14、到Web界面更改语言

##########zabbix的简单安装就到这里了,Yum的还是比较方便的###########

编译安装URL如下:http://www.cnblogs.com/yangxiaofei/p/5435460.html

CentOS 6.4编译搭建Zabbix 2.0版本(中文)

 

posted on 2016-04-26 10:54  毕竟我是杨小飞i  阅读(631)  评论(0编辑  收藏  举报