1.安装epel源和zabbix源

rpm -ivh epel-release-latest-6.noarch.rpm zabbix-release-2.2-1.el6.noarch.rpm

2.安装zabbix

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

3.安装mysql

yum -y install mysql-server

4.配置mysql

vim /etc/my.cnf

[mysqld]

datadir=/home/data/mysql

pid-file=/var/run/mysqld/mysqld.pid

socket=/var/lib/mysql/mysql.sock

user=mysql

symbolic-links=0

character-set-server=utf8

default-character-set=utf8

innodb_file_per_table=1

log-error=/home/data/mysql/log_err.log

log-slow-queries=/home/data/mysql/log_slow.log

long_query_time=10

innodb_buffer_pool_size = 8192M

max_connections = 1000

[client]

default-character-set=utf8

#启动mysql

/etc/init.d/mysqld restart

5.创建zabbix数据库

mysqladmin -uroot password "000000"

mysql -uroot -p000000

create database zabbix character set utf8;

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

flush privileges;

#初始化数据库

use zabbix;

source /usr/share/doc/zabbix-server-mysql-2.2.11/create/schema.sql;

source /usr/share/doc/zabbix-server-mysql-2.2.11/create/p_w_picpaths.sql;

source /usr/share/doc/zabbix-server-mysql-2.2.11/create/data.sql;

6.配置zabbix

vim /etc/zabbix/zabbix_server.conf

LogFile=/var/log/zabbix/zabbix_server.log

LogFileSize=0

PidFile=/var/run/zabbix/zabbix_server.pid

DBName=zabbix

DBUser=zabbix

DBSocket=/var/lib/mysql/mysql.sock

StartPollers=150

StartIPMIPollers=0

StartPollersUnreachable=50

StartTrappers=30

StartPingers=50

StartDiscoverers=5

StartHTTPPollers=5

StartJavaPollers=0

StartVMwareCollectors=0

SNMPTrapperFile=/var/log/snmptt/snmptt.log

StartSNMPTrapper=0

CacheSize=4096M

CacheUpdateFrequency=120

StartDBSyncers=10

HistoryCacheSize=2048M

TrendCacheSize=2048M

HistoryTextCacheSize=2048M

ValueCacheSize=8192M

Timeout=20

UnreachablePeriod=45

UnavailableDelay=30

UnreachableDelay=15

AlertScriptsPath=/usr/lib/zabbix/alertscripts

ExternalScripts=/usr/lib/zabbix/externalscripts

FpingLocation=/usr/sbin/fping

StartProxyPollers=0

DBHost=localhost

DBPassword=zabbix

7.其他

修改php时区:

vim /etc/php.ini

date.timezone = Asia/Shanghai

修改主机名:

vim /etc/sysconfig/network

HOSTNAME=zabbix

修改hosts:

vim /etc/hosts

127.0.0.1   zabbix zabbix.com

同步时间:

ntpdate 10.0.0.254

hwclock -w

8.添加开机启动

chkconfig httpd on

chkconfig mysqld on

chkconfig zabbix-server on

chkconfig zabbix-agent on

9.重启server