1、zabbix 3.0.3

2、agent

3、proxy

    doc:https://www.zabbix.com/documentation/3.0/manual/introduction


一、安装部署Zabbix Server

   Zabbix Server可以运行在 CentOS 、 RedHat Linux 、 Debain 等 Linux 系统上,这里以centos6.5-X86_X64 作为部署环境。

    zabbix 3.0版本中文觉得像是内地版的语法翻译了;以往版本的中文翻译总是台味太重;


二、

    1.1 

    服务端安装 LAMP 环境;

# yum -y 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 iotop iftop 

   //**  如果执行nopack 或 yum 问题;可以更新yum源;

# yum -ivh http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm

    //** 如果想换成nginx 也是一样可以;

# yum install nginx -y



   1.2 

    服务端配置 lamp 使用环境

根据zabbix 需求设置 php.ini

如果不想手工修改,可以使用以下 sed 命令操作;

sed -i "s/;date.timezone =/date.timezone = Asia\/Shanghai/g"  /etc/php.ini

sed -i "s#max_execution_time = 30#max_execution_time = 300#g" /etc/php.ini

sed -i "s#post_max_size = 8M#post_max_size = 32M#g"   /etc/php.ini

sed -i "s#max_input_time = 60#max_input_time = 300#g" /etc/php.ini

sed -i "s#memory_limit = 128M#memory_limit = 128M#g"  /etc/php.ini

sed -i "/;mbstring.func_overload = 0/ambstring.func_overload = 2\n" /etc/php.ini


    1.2.1 

    设置开机自启 httpd、 mysqld 服务;

# chkconfig mysqld on

# chkconfig httpd on

# service mysqld start

# service httpd start


  三、

    zabbix服务端的安装过程(如今刚好到3版本了,自我感觉界面比3.0.3之前版本好)

1.1

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

    安装 zabbix 服务

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

yum install zabbix-agent -y


1.2

    设置数据库

Creating initial database 

# mysqladmin -uroot -p password 'mysql'

    // *** 默认安装的mysql 无密码;需要设置密码;

# mysql -uroot

mysql> create database zabbix character set utf8 collate utf8_bin;

    // *** 创建zabbix 数据库;设置支持utf8 支持;

mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';

    // *** 设置zabbix web安装时候链接数据库;

mysql> exit


    导入数据:

zcat /usr/share/doc/zabbix-server-mysql-3.0.X/create.sql.gz | mysql -uroot -p mysql

    // *** 原3.0之前导入数据:

# cd /usr/share/doc/zabbix-server-mysql/create

# mysql -uroot zabbix < schema.sql

# mysql -uroot zabbix < p_w_picpaths.sql

# mysql -uroot zabbix < data.sql


1.3

Starting Zabbix server process

更改 zabbix server 配置文件;

# vi /etc/zabbix/zabbix_server.conf

DBHost=localhost

DBName=zabbix

DBUser=zabbix

DBPassword=zabbix

DBPort=3306

    也可以使用sed替换更改:

sed -i 's/# DBHost=localhost/DBHost=localhost/g' /etc/zabbix/zabbix_server.conf

sed -i 's/# DBPassword=/DBPassword=zabbix/g' /etc/zabbix/zabbix_server.conf  

egrep "DBHost|DBName|DBUser|DBPassword" /etc/zabbix/zabbix_server.conf  

### Option: DBHost

DBHost=localhost

    ### Option: DBName

#       For SQLite3 path to database file must be provided. DBUser and DBPassword are ignored.

# DBName=

DBName=zabbix

### Option: DBUser

# DBUser=

DBUser=zabbix

### Option: DBPassword

DBPassword=zabbix


四、

开启zabbix 服务;

# service zabbix-server start

    1.4 

检测安装RPM包;

# rpm -qa zabbix*

zabbix-release-2.2-1.el6.noarch

zabbix-server-2.2.11-1.el6.x86_64

zabbix-web-2.2.11-1.el6.noarch

zabbix-2.2.11-1.el6.x86_64

zabbix-server-mysql-2.2.11-1.el6.x86_64

zabbix-web-mysql-2.2.11-1.el6.noarch

zabbix-agent-2.2.11-1.el6.x86_64

1.4.1 检测rpm包

# rpm -ql zabbix-web 

    // ***  查看yum安装的zabbix的web安装文件位置

# cd /usr/share/zabbix

# ls

acknow.php                     index.php

actionconf.php                 items.php

adm.gui.php                    js

adm.housekeeper.php            jsLoader.php

adm.iconmapping.php            jsrpc.php

adm.p_w_picpaths.php                 latest.php

adm.macros.php                 locale

adm.other.php                  maintenance.php

adm.regexps.php                map.php

adm.triggerdisplayoptions.php  maps.php

adm.triggerseverities.php      media_types.php

adm.valuemapping.php           nodes.php

adm.workingtime.php            overview.php

api                            popup_bitem.php

api_jsonrpc.php                popup_httpstep.php

applications.php               popup_media.php

audio                          popup_period.php

auditacts.php                  popup.php

auditlogs.php                  popup_right.php

authentication.php             popup_trexpr.php

browserwarning.php             popup_usrgrp.php

chart2.php                     profile.php

chart3.php                     proxies.php

chart4.php                     queue.php

chart5.php                     report1.php

chart6.php                     report2.php

chart7.php                     report3.php

chart_bar.php                  report4.php

chart.php                      report5.php

charts.php                     report6.php

conf                           robots.txt

conf.import.php                screenconf.php

dashboard.php                  screenedit.php

dashconf.php                   screens.php

discoveryconf.php              scripts_exec.php

discovery.php                  scripts.php

disc_prototypes.php            search.php

events.php                     services.php

fonts                          setup.php

graphs.php                     slideconf.php

history.php                    slides.php

host_discovery.php             srv_status.php

hostgroups.php                 styles

hostinventoriesoverview.php    sysmap.php

hostinventories.php            sysmaps.php

host_prototypes.php            templates.php

host_screen.php                tr_comments.php

hosts.php                      tr_events.php

httpconf.php                   trigger_prototypes.php

httpdetails.php                triggers.php

httpmon.php                    tr_logform.php

p_w_picpath.php                      tr_status.php

p_w_picpaths                         tr_testexpr.php

imgstore.php                   usergrps.php

include                        users.php


#mv zabbix /var/www/html/

    // *** 拷贝zabbix 程序文件到默认的web 目录下;

五、    重启web服务进行访问;

# /etc/init.d/httpd restart  

Stopping httpd:                                      [  OK  ]

Starting httpd:                                      [  OK  ]

    

1.5

    URL访问:

http://IP/zabbix/

Zabbix 3.0.3 安装_第1张图片

    // *** 默认 username/password is Admin/zabbix

Zabbix 3.0.3 安装_第2张图片

    至此 zabbix3.0.3 yum 安装完毕~