centos7系统中监控端zabbix的简单部署

本机环境:

[root@m01 ~]# cat /etc/redhat-release 
CentOS Linux release 7.4.1708 (Core) 
[root@m01 ~]# uname -a
Linux m01 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[root@m01 ~]# hostname -I
10.0.0.61 172.16.1.61 

安装zabbix

rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm

安装zabbix相关依赖

yum install zabbix-server-mysql zabbix-web-mysql

 

根据这两个互为依赖的安装可以看出已经安装好了httpd和php所以我们不需要部署这两个环境了

部署数据库服务:

centos7系列因为有“洁癖”将mysql去除了yum仓库,使用了mariadb作为替代,但在使用上这只小海豹和小海豚没什么区别包括命令和sql语句都是一样的。

安装mariaDB:

yum -y install mariadb-server
systemctl start mariadb.service

创建zabbix表和用户

[root@m01 ~]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.56-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| test               |
| zabbix             |
+--------------------+
5 rows in set (0.00 sec)

MariaDB [(none)]> exit
Bye

导入zabbix的数据文件

[root@m01 ~]# zcat /usr/share/doc/zabbix-server-mysql-3.0.13/create.sql.gz|mysql -uzabbix -pzabbix zabbix

配置zabbix server链接数据库(因为之前创建的zabbix库的密码为zabbix,所以将密码添加为zabbix关键位置:

修改httpd和php的配置使其时区为上海

启动服务:

systemctl start zabbix-server
systemctl start httpd

接下来就可以在web网页上配置了点击下一步即可

该区块可以检查你的lamp环境是否达到最低要求:

这里填写mysql相关的信息

完成后一直点下一步就ok了

 

登陆完成后会看到如下页面:

右上角点击这里:

可以设置中文:

 

posted on 2017-11-20 16:50  ExzaiTin  阅读(227)  评论(0编辑  收藏  举报

导航