一、zabbix安装环境
zabbix的安装配置是个较繁杂的过程,它是基于lamp或lnmp,只不过之前装的lamp架构可能无法满足zabbix的需求,比如某些php的扩展,所以我建议重装php。
1、查看linux的版本信息
[root@localhost ~]# lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.3 (Final)
Release: 6.3
Codename: Final
2、MySQL的版本信息
mysql> select version();
+------------------+
| version() |
+------------------+
| 5.6.10-debug-log |
+------------------+
1 row in set (0.00 sec)
3、PHP版本信息
[root@localhost ~]# php -v
PHP 5.3.27 (cli) (built: Nov 18 2013 10:08:05)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
4、Apache版本信息
[root@localhost bin]# /usr/local/apache2/bin/httpd -v
Server version: Apache/2.2.23 (Unix)
Server built: Oct 28 2013 02:38:35
二、zabbix 服务端的安装
1、下载zabbix的源码包并解压
wget %20Latest%20Stable/2.2.0/zabbix-2.2.0.tar.gz
[root@localhost softs]# tar xf zabbix-2.2.0.tar.gz -C /usr/src/
[root@localhost src]# cd zabbix-2.2.0/
2、建立相应的用户组与用户
[root@localhost zabbix-2.2.0]# groupadd -r zabbix
[root@localhost zabbix-2.2.0]# useradd -g zabbix -s /sbin/nologin zabbix
3、登录mysql ,创建zabbix用户并授权
[root@localhost zabbix-2.2.0]# mysql -u root -p******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4773
Server version: 5.6.10-debug-log Source distribution
…………
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database zabbix; ###新建zabbix数据库
Query OK, 1 row affected (0.01 sec)
mysql> grant all on zabbix.* to zabbix@localhost identified by 'zabbix'; ###创建zabbix用户
Query OK, 0 rows affected (0.16 sec)
mysql> flush privileges; #刷新授权表及时生效
Query OK, 0 rows affected (0.00 sec)
4、导入zabbix自带的几个sql脚本
[root@localhost ~]# cd /usr/src/zabbix-2.2.0/
[root@localhost zabbix-2.2.0]# cd database/
[root@localhost database]# ls
ibm_db2 Makefile.in Oracle sqlite3
Makefile.am mysql postgresql
[root@localhost database]# cd mysql/
[root@localhost mysql]# ls
data.sql images.sql schema.sql
[root@localhost mysql]# mysql -u root -p123456 zabbix < schema.sql
[root@localhost mysql]# mysql -u root -p123456 zabbix < images.sql
[root@localhost mysql]# mysql -u root -p123456 zabbix < data.sql
ZABBIX 的详细介绍:请点这里
ZABBIX 的下载地址:请点这里
相关阅读:
安装部署分布式监控系统Zabbix 2.06
《安装部署分布式监控系统Zabbix 2.06》
CentOS 6.3下Zabbix安装部署
CentOS 6.3下Zabbix监控apache server-status