阿尔海南粉 发表于 2019-1-21 13:26:25

Centos7yum安装zabbix3.0

特点
  1、分布式监控
2、支持自动发现网络设备和服务器
3、设置报警值并通知管理员
4、支持图表
5、支持监控多种服务和跨平台系统监控
6、开源
IE --> B/S
注:需运行在LAMP平台之上
原理
  1、Zabbix_Server:在LAMP平台环境下使用
2、Zabbix_Agent:搜集客户端数据传输给Server
3、SNMP:搜索网络设备数据传输给Server
搭建环境
  系统版本:Centos7x 3.10.0-514.el7.x86_64(两台)
  zabbix软件版本:zabbix-server-mysql.x86_64 0:3.2.11-1.el7
  MySQL版本:mysql-community-server.x86_64 0:5.7.22-1.el7
  平台部署: 搭建LAMP平台(根据服务器性能可在同台或分开搭建)
  关闭防火墙 systemctl stop firewalld.service
  禁止防火墙开机自启 systemctl disable firewalld.service
  关闭selinux
sed -i 's/SELINUX=enforcing /SELINUX=disabled/g'
/etc/sysconfig/selinux
  重启系统即可 reboot
一、部署Zabbix_server端(IP:192.168.1.10 )
1、安装zabbix仓库
  rpm -vhi http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
http://i2.运维网.com/images/blog/201807/16/52181231dc22647ab891689b296552d0.png
2、安装zabbix-server和web以及 mysql依赖包
  yum install -y zabbix-server-mysql zabbix-web-mysql
http://i2.运维网.com/images/blog/201807/16/93a49b01780b1e75a75fd481ff05c647.png
3、安装MySQL数据库
  1)由于yum源上没有mysql-server。所以必须去官网下载,这里 我们用wget命令,直接获取)wget -i –c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
http://i2.运维网.com/images/blog/201807/16/c20be38d964de86f3827c75e5133b702.png
  查看下载的mysql的rpm依赖包
http://i2.运维网.com/images/blog/201807/16/f8fb7bfba9660bb8f14087da7fb6c6b3.png
  2)安装mysql数据库依赖包
yum -y install mysql57-community-release-el7-10.noarch.rpm
http://i2.运维网.com/images/blog/201807/16/8311a80b30ac91a98a56db85a124edd8.png
  3)安装mysql数据库
yum -y install mysql-community-server
http://i2.运维网.com/images/blog/201807/16/a3109fdbc96f21921c51feeaa3c63b08.png
http://i2.运维网.com/images/blog/201807/16/868b8ba5dfae463b9cfecf624c7ce99c.png
  4)启动数据库并设置为开机自启
启动数据库    systemctl start mysqld
http://i2.运维网.com/images/blog/201807/16/4b36a0c454e51a404b09bbe0efba299a.png
  开机自启systemctl enablemysqld
http://i2.运维网.com/images/blog/201807/16/6f47687c4c77905b769502f501dc15be.png
  5)查看数据库默认密码
cat /var/log/mysqld.log | grep password
http://i2.运维网.com/images/blog/201807/16/4ce36883c383b72c34f1191332afcccc.png
  6)初始化数据库   
mysql_secure_installation
http://i2.运维网.com/images/blog/201807/16/6c1779d89037b203517757c253ad18d2.png
http://i2.运维网.com/images/blog/201807/16/4ea4bee8e853e4cc097a81f5e90093e0.png
http://i2.运维网.com/images/blog/201807/16/e296725585cf2ffa94efab556ac905db.png
4、创建数据库和用户
  首先使用root用户登录,然后执行如下命令
mysql> create database zabbix character set utf8;
mysql> grant all on zabbix.* to zabbix@'localhost' identified by ' Zabbix.com.123';
mysql> flush privileges;
5、导入默认zabbix数据库信息
  zcat /usr/share/doc/zabbix-server-mysql-3.0.19/create.sql.gz | mysql zabbix -uzabbix-p
http://i2.运维网.com/images/blog/201807/16/61009bd30b240e5767884fa4a7580991.png
6、修改zabbix配置文件
  1)修改配置文件    vi /etc/zabbix/zabbix_server.conf
http://i2.运维网.com/images/blog/201807/16/bfce7d8b7293e57af83c5a2fb063a498.png
http://i2.运维网.com/images/blog/201807/16/4838f1a7460b0bbf8966b209e648fc6f.png
http://i2.运维网.com/images/blog/201807/16/1beb30dd5a6f9005789a6700b72521b8.png
  2)启动zabbix服务   systemctl start zabbix-server
7、修改httpd配置文件
  1)修改配置文件    vi /etc/httpd/conf.d/zabbix.conf
http://i2.运维网.com/images/blog/201807/16/e5d59d415bf995a51d84e0bc21e1f959.png
  2)启动httpd服务    systemctl start httpd
8、查看zabbix日志
http://i2.运维网.com/images/blog/201807/16/00e0bfe3606bd36b3134674f0a910bb9.png
9、网页安装测试
  访问网址:http://192.168.1.10/zabbix
  1)检验先决条件看看是否有问题,然后点击Next step;
http://i2.运维网.com/images/blog/201807/16/1da5043bb5e8cef24285f3031d7ff3d0.png
  2)根据自己实际情况填写,然后点击Next step;
http://i2.运维网.com/images/blog/201807/16/bb1c1a4ea17e2efb35286a67a03bf8c2.png
  3)指定名称,然后点击Next step;
http://i2.运维网.com/images/blog/201807/16/6a7272ec273df2909b354e5c185132c7.png
  4)检查添加信息无误,然后点击Next step;
http://i2.运维网.com/images/blog/201807/16/8c471ff3f3576d1449f32c1465290cdf.png
  5)安装完成,然后点击Finish;
http://i2.运维网.com/images/blog/201807/16/a201e2d41ebee885c6793cb8f698e461.png
  6)登陆zabbix网页
http://i2.运维网.com/images/blog/201807/16/747f7c0bbd6a9a6ba96eae3703ac7024.png
注:如果想监控自己本身的服务器那么也需要安装agent端,具体安装如下!
二、部署Zabbix_agent端(IP:192.168.1.20)
1、安装zabbix仓库
  rpm -vhi http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
http://i2.运维网.com/images/blog/201807/16/eae1a17f044145530ef0f9a04d250ce0.png
2、安装zabbix客户端
  yum -y install zabbix-agent
http://i2.运维网.com/images/blog/201807/16/96f3c67240e1c6eb1e5801d142047179.png
3、编辑客户端配置文件
  vi /etc/zabbix/zabbix_agentd.conf
http://i2.运维网.com/images/blog/201807/16/f32014bb3a6d8376eed21e0fbcb6e5d2.png
http://i2.运维网.com/images/blog/201807/16/8d7c701761718ef9a3ab6b53865e8e6a.png
4、启动客户端服务
  1)启动客户端       systemctl start zabbix-agent
  2)设置开机自启   systemctl enable zabbix-agent
5、设置邮件报警
  参考网址:https://www.cnblogs.com/saneri/p/6078069.html
三、解决zabbix页面字体乱码方块问题
  具体解决方式可以参考上一篇文章Centos7解决zabbix网页显示乱码
注:到这里就完全使用yum安装完成了,如有疑问,欢迎随时叨扰!



页: [1]
查看完整版本: Centos7yum安装zabbix3.0