[root@jymlinux ~]# rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm
Retrieving http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm
warning: /var/tmp/rpm-tmp.QBkmAF: Header V4 DSA/SHA1 Signature, key ID 79ea5ed4: NOKEY
Preparing... ########################################### [100%]
1:zabbix-release ########################################### [100%][root@jymlinux ~]# yum clean all
已加载插件:fastestmirror, langpacks
正在清理软件源: base extras updates zabbix zabbix-non-supported
Cleaning up everything
Cleaning up list of fastest mirrors
[root@jymlinux ~]# yum makecache (3)rpm包下载安装
2.配置zabbix-database,以mysql为例,可使用mysql和pgsql
MariaDB [(none)]> create database zabbix character set utf8;
MariaDB [(none)]> grant all on zabbix.* to 'zbxuser'@'localhost' identified by 'zbxpass';
MariaDB [(none)]> grant all on zabbix.* to 'zbxuser'@'192.168.%.%' identified by 'zbxpass';
MariaDB [(none)]> flush privileges;
#连接测试
[root@jymlinux ~]# mysql -uzbxuser -hlocalhost -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 5.5.50-MariaDB MariaDB Server
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> \q
Bye
3.安装zabbix
[root@jymlinux ~]# yum install zabbix zabbix-agent zabbix-get zabbix-sender zabbix-server zabbix-server-mysql zabbix-web zabbix-web-mysql
在httpd中生成zabbix-web的配置文件
[root@jymlinux ~]# cd /etc/zabbix/
[root@jymlinux zabbix]# ls
web zabbix_agentd.conf zabbix_agentd.d zabbix_server.conf
[root@jymlinux zabbix]# service httpd start
Starting httpd:
[root@jymlinux zabbix]# ls /etc/httpd/conf.d
php.conf README welcome.conf zabbix.conf #有了zabbix.conf这个文件
将zabbix导入数据库
[root@jymlinux zabbix]# cd /usr/share/doc/zabbix-server-mysql-2.4.8/
[root@jymlinux zabbix-server-mysql-2.4.8]# cd create/
[root@jymlinux create]# mysql zabbix < schema.sql #注意导入顺序
[root@jymlinux create]# mysql zabbix < images.sql
[root@jymlinux create]# mysql zabbix < data.sql
#如果仅为proxy创建数据库,只导入schema.sql即可
4.配置zabbix-server
[root@jymlinux ~]# vim /etc/zabbix/zabbix_server.conf
### Option: DBHost
# Database host name.
# If set to localhost, socket is used for MySQL.
# If set to empty string, socket is used for PostgreSQL.
#
# Mandatory: no
# Default:
# DBHost=localhost
DBHost=192.168.3.8 #填写连接的数据库服务器,默认是本机
### Option: DBUser
# Database user. Ignored for SQLite.
#
# Mandatory: no
# Default:
# DBUser=
DBUser=zabbix
### Option: DBPassword
# Database password. Ignored for SQLite.
# Comment this line if no password is used.
#
# Mandatory: no
# Default:
# DBUser=
DBUser=zbxuser #填写数据库用户名
### Option: DBPassword
# Database password. Ignored for SQLite.
# Comment this line if no password is used.
#
# Mandatory: no
# Default:
# DBPassword=
DBPassword=zbxpass #填写数据库密码