一、安装:
服务器端:
[root@localhost ~]# yum -y localinstall zabbix-2.0.8-3.el6.x86_64.rpm zabbix-get-2.0.8-3.el6.x86_64.rpm zabbix-server-2.0.8-3.el6.x86_64.rpm zabbix-server-mysql-2.0.8-3.el6.x86_64.rpm zabbix-web-2.0.8-3.el6.noarch.rpm zabbix-web-mysql-2.0.8-3.el6.noarch.rpm
#
#安装包有些依赖epel源,所以请自行添加epel到本机的repo文件,下面提供一个互联网的yum源:针对centos6.X系列
#
[Mirror.sohu]
name=Mirror.sohu.com
baseurl=http://mirror.sohu.com/centos/6/os/$basearch/
enabled=1
gpecheck=0
[fedora-epel]
name=fedora-epel
baseurl=http://mirror.sohu.com/fedora-epel/6/$basearch/
enabled=1
gpgcheck=0
#
#安装包所依赖的包有:
Installing:
zabbix x86_64 2.0.8-3.el6 /zabbix-2.0.8-3.el6.x86_64
zabbix-get x86_64 2.0.8-3.el6 /zabbix-get-2.0.8-3.el6.x86_64
zabbix-server x86_64 2.0.8-3.el6 /zabbix-server-2.0.8-3.el6.x86_64
zabbix-server-mysql x86_64 2.0.8-3.el6 /zabbix-server-mysql-2.0.8-3.el6.x86_64
zabbix-web noarch 2.0.8-3.el6 /zabbix-web-2.0.8-3.el6.noarch
zabbix-web-mysql noarch 2.0.8-3.el6 /zabbix-web-mysql-2.0.8-3.el6.noarch
Installing for dependencies:
OpenIPMI-libs x86_64 2.0.16-14.el6 base
apr x86_64 1.3.9-5.el6_2 base
apr-util x86_64 1.3.9-3.el6_0.1 base
apr-util-ldap x86_64 1.3.9-3.el6_0.1 base
dejavu-fonts-common noarch 2.30-2.el6 base
dejavu-sans-fonts noarch 2.30-2.el6 base
fontpackages-filesystem noarch 1.41-1.1.el6 base
fping x86_64 2.4b2-10.el6 epel
httpd x86_64 2.2.15-26.el6.centos base
httpd-tools x86_64 2.2.15-26.el6.centos base
iksemel x86_64 1.4-2.el6 epel
libXpm x86_64 3.5.10-2.el6 base
libtool-ltdl x86_64 2.2.6-15.5.el6 base
libxslt x86_64 1.1.26-2.el6_3.1 base
lm_sensors-libs x86_64 3.1.1-17.el6 base
mailcap noarch 2.1.31-2.el6 base
net-snmp x86_64 1:5.5-44.el6 base
net-snmp-libs x86_64 1:5.5-44.el6 base
php x86_64 5.3.3-22.el6 base
php-bcmath x86_64 5.3.3-22.el6 extra
php-cli x86_64 5.3.3-22.el6 base
php-common x86_64 5.3.3-22.el6 base
php-gd x86_64 5.3.3-22.el6 base
php-mbstring x86_64 5.3.3-22.el6 extra
php-mysql x86_64 5.3.3-22.el6 base
php-pdo x86_64 5.3.3-22.el6 base
php-xml x86_64 5.3.3-22.el6 base
unixODBC x86_64 2.2.14-12.el6_3 base
修改zabbix配置文件:
[root@localhost ~]# cd /etc/zabbix/
# 根据实际情况修改数据库的相关信息和本机zabbix服务监听地址
[root@localhost zabbix]# vi zabbix_server.conf
ListenIP=172.16.1.6 或0.0.0.0
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=redhat
启动mysql数据库为zabbix授权用户并导入初始数据
[root@localhost ~]# yum -y install mysql-server
[root@localhost ~]# service mysqld start
[root@localhost ~]# chkconfig mysqld on
[root@localhost zabbix]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.66 Source distribution
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
# mysql> grant all on zabbix.* to 'zabbix'@'localhost' identified by 'redhat';
Query OK, 0 rows affected (0.00 sec)
# mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
#
#为使得zabbix可以支持中文,在创建数据库时要设定字符集为utf8.
# mysql> create database zabbix charset utf8;
Query OK, 1 row affected (0.00 sec)
#
#
#导入初始数据库数据,注意:请按顺序导入
[root@localhost zabbix]# mysql -uzabbix -hlocalhost -predhat zabbix < /usr/share/doc/zabbix-server-mysql-2.0.8/create/schema.sql
[root@localhost zabbix]# mysql -uzabbix -hlocalhost -predhat zabbix < /usr/share/doc/zabbix-server-mysql-2.0.8/create/images.sql
[root@localhost zabbix]# mysql -uzabbix -hlocalhost -predhat zabbix < /usr/share/doc/zabbix-server-mysql-2.0.8/create/data.sql
zabbix-web安装后生成zabbix.conf,web访问的相关属性可以设置配置文件
[root@localhost ~]# ls /etc/httpd/conf.d/
php.conf README welcome.conf zabbix.conf
#
#启动httpd、mysqld、zabbix-server服务
[root@zabbix ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[root@zabbix ~]# service zabbix-server restart
Shutting down Zabbix server: [ OK ]
Starting Zabbix server: [ OK ]
[root@zabbix ~]# service mysqld restart
Stopping mysqld: [ OK ]
Starting mysqld: [ OK ]
[root@zabbix ~]# netstat -tnl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 172.16.1.6:10051 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
tcp 0 0 :::80 :::* LISTEN
修改php.ini中关于时区的定义:
[root@zabbix ~]# vi /etc/php.ini
date.timezone = Asia/Chongqing
[root@zabbix ~]# service httpd restart