全程使用yum安装zabbix记录
环境准备:web环境(apache,php,mysql)三个都使用yum来安装
准备yum源,使用阿里的源(新浪源安装apache的时候有问题)
1
# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
安装php,apache,mysql
1
2
# yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
# yum install mysql-server mysql
web环境已准备
设置mysql密码,并创建zabbix数据库
1
2
3
4
5
6
7
8
9
10
11
12
13
# mysql -uroot
Welcome to the MySQL monitor.Commands end with ; or g.
Your MySQL connection id is 3
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2013, 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> set password for 'root'@'localhost'=password('123456');
Query OK, 0 rows affected (0.00 sec)
mysql> create database zabbix character set utf8;
Query OK, 1 row affected (0.00 sec)
使用yum安装zabbix
先获取第三方源
1
rpm -ivh http://repo.zabbix.com/zabbix/2. ... .4-1.el6.noarch.rpm
开始安装
1
# yum install zabbix-server-mysql zabbix-web-mysql
查看其安装后的路径
1
2
# whereis zabbix
zabbix: /etc/zabbix /usr/lib/zabbix /usr/share/zabbix
进入zabbix的数据库信息目录
1
2
3
4
5
6
# cd /usr/share/doc/zabbix-server-mysql-2.4.2/create
# ll
总用量 2988
-rw-r--r--. 1 root root972744 11月 10 19:25 data.sql
-rw-r--r--. 1 root root 1978341 11月5 16:01 images.sql
-rw-r--r--. 1 root root104816 11月5 16:02 schema.sql
把zabbix数据库脚本导入到数据库中
要按以下顺序导入,否则会报错
1
2
3
# mysql -uroot -p123456 zabbix < schema.sql
# mysql -uroot -p123456 zabbix < images.sql
# mysql -uroot -p123456 zabbix < data.sql
修改zabbix配置文件信息
1
2
3
4
5
6
7
8
9
10
11
# cd /etc/zabbix/
# ll
总用量 20
drwxr-x---. 2 apache apache4096 12月3 15:02 web
-rw-r-----. 1 root zabbix 13184 11月 10 19:32 zabbix_server.conf
# cp zabbix_server.conf zabbix_server.conf.bak20141203
# vim zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
最后将zabbix站点添加到apache中(直接yum安装会直接自动添加zabbix配置文件)
启动服务
1
2
3
4
5
6
# service httpd start
正在启动 httpd:httpd: apr_sockaddr_info_get() failed for puppet_master
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[确定]
# service zabbix-server start
Starting Zabbix server: [确定]
剩下的就从页面配置了
http://192.168.164.132/zabbix/setup.php
后续记录
修改php.ini文件中的
date.timezone ='Asia/Chongqing'
否则页面安装提示没有time zone内容,并且要改为chongqing地区。
页:
[1]