当前位置:网站首页>分步式监控平台zabbix
分步式监控平台zabbix
2022-07-07 13:44:00 【橘子超好吃】
一、zabbix简介
1、什么是zabbix
- zabbix 是一个基于 Web 界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案。
- zabbix 能监视各种网络参数,保证服务器系统的安全运营;并提供灵活的通知机制以让系统管理员快速定位/解决存在的各种问题。
- zabbix 由 2 部分构成,zabbix server 与可选组件 zabbix agent。通过 C/S 模式采集数据,通过 B/S 模式在 Web 端展示和配置。
- zabbix server 可以通过 SNMP,zabbix agent,ping,端口监视等方法提供对远程服务器/网络状态的监视,数据收集等功能, 它可以运行在 Linux 等平台上。
- zabbix agent 需要安装在被监视的目标服务器上,它主要完成对硬件信息或与操作系统有关的内存,CPU 等信息的收集。
2、zabbix监控原理:
zabbix agent安装在被监控的主机上,zabbix agent负责定期收集客户端本地各项数据,并发送至 zabbix server 端,zabbix server 收到数据后,将数据存储到数据库中,用户基于 Zabbix WEB 可以看到数据在前端展现图像。当 zabbix 监控某个具体的项目, 该项目会设置一个触发器阈值,当被监控的指标超过该触发器设定的阈值,会进行一些必要的动作,动作包括:发送信息(邮件、微信、短信)、发送命令(shell 命令、reboot、restart、install 等)。
3、zabbix常见的5个程序
abbix 监控部署在系统中,包含常见的五个程序: zabbix_server、zabbix_agent、zabbix_proxy、zabbix_get、zabbix_sender 等。
- zabbix server:zabbix 服务端守护进程,其中 zabbix_agent、zabbix_get、zabbix_sender、zabbix_proxy 的数据最终都提交给 zabbix server;
- zabbix agent:客户端守护进程,负责收集客户端数据,例如:收集 CPU 负载、内存、硬盘使用情况等;
- zabbix proxy:zabbix 分布式代理守护进程,通常大于 500 台主机,需要进行分布式监控架构部署;
- zabbix get:zabbix 数据接收工具,单独使用的命令,通常在 server 或者 proxy 端执行获取远程客户端信息的命令;
- zabbix sender:zabbix 数据发送工具,用户发送数据给 server 或 proxy 端,通常用户耗时比较长的检查。
二、安装zabbix
实验准备
zabbix-server:20.0.0.5
zabbix-agent:20.0.0.6
1.##关闭防火墙,修改主机名
systemctl disable --now firewalld
setenforce 0
hostnamectl set-hostname zbx-server
su
##2、获取zabbix 的下载源
rpm -ivh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
##3、更换 zabbix.repo 为阿里源,安装zabbix-server-mysql和zabbix-agent
cd /etc/yum.repos.d
sed -i 's#http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix#' zabbix.repo
yum clean all && yum makecache
yum install -y zabbix-server-mysql zabbix-agent
#安装SCL(Software Collections),便于后续安装高版本的 php,默认 yum 安装的 php 版本为 5.4,版本过低,zabbix 5.0 版本对 php 版本最低要 7.2.0 版本。SCL 可以使得在同一台机器上使用多个版本的软件,而又不会影响整个系统的依赖环境。软件包会安装在 /etc/opt/rh 目录下。
yum install -y centos-release-scl
##4、修改 zabbix-front 前端源,安装 zabbix 前端环境到 scl 环境下
vim /etc/yum.repos.d/zabbix.repo
......
[zabbix-frontend]
......
enabled=1 #开启安装源
......
yum install -y zabbix-web-mysql-scl zabbix-apache-conf-scl #安装zabbix前端环境到 scl 环境下
##5、安装 zabbix 所需的数据库
yum install -y mariadb-server mariadb
systemctl enable --now mariadb #将数据库设置为开机自启,并立即启动
mysql_secure_installation #初始化数据库,并设置密码,如 abc123
##6、添加数据库用户,以及 zabbix 所需的数据库信息
mysql -u root -pabc123 #登录数据库
CREATE DATABASE zabbix character set utf8 collate utf8_bin; #设置utf8字符集
GRANT all ON zabbix.* TO 'zabbix'@'%' IDENTIFIED BY 'zabbix'; #创建并授权用户,使得zabbix可以访问数据库
flush privileges; #刷新权限
#查询已安装的zabbix-server-mysql的文件列表,找到 sql.gz 文件的位置
rpm -ql zabbix-server-mysql
#导入数据库信息,使用zcat将sql.gz文件导入数据库
zcat /usr/share/doc/zabbix-server-mysql-5.0.25/create.sql.gz | mysql -uroot -pabc123 zabbix
##7、修改 zabbix-server 配置文件,修改数据库的密码
vim /etc/zabbix/zabbix_server.conf
......
DBPassword=zabbix #124行,取消注释,指定 zabbix 数据库的密码,DBPassword的值是数据库授权zabbix用户的密码。
##8、修改 zabbix 的 php 配置文件
vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf
......
php_value[date.timezone] = Asia/Shanghai #25行,取消注释,修改时区
##启动 zabbix 相关服务
systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm
systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm
浏览器访问:http://20.0.0.5/zabbix
点击下一步,设置数据库的密码 zabbix
安装完成后,默认的登录账号和密码为:Admin/zabbix
设置文件界面:点击左边菜单栏的【User settings】,【Language】选择 Chinese(zh_CN),再点击 Update 更新。
解决 zabbix-server Web页面中文乱码问题
yum install -y wqy-microhei-fonts
cp -f /usr/share/fonts/wqy-microhei/wqy-microhei.ttc /usr/share/fonts/dejavu/DejaVuSans.ttf
边栏推荐
- There are many ways to realize the pause function in JS
- Three. JS introductory learning notes 0: illustration of how webgl and threejs work
- Learn good-looking custom scroll bars in 1 minute
- Create lib Library in keil and use lib Library
- How does geojson data merge the boundaries of regions?
- numpy---基础学习笔记
- XMIND frame drawing tool
- Webgl texture
- Shader_ Animation sequence frame
- Use of SVN
猜你喜欢
深度之眼(七)——矩阵的初等变换(附:数模一些模型的解释)
[wechat applet] Chapter (5): basic API interface of wechat applet
Spin animation of Cocos performance optimization
一大波开源小抄来袭
【數字IC驗證快速入門】20、SystemVerilog學習之基本語法7(覆蓋率驅動...內含實踐練習)
A wave of open source notebooks is coming
It's different for rich people to buy a house
Three. JS introductory learning notes 04: external model import - no material obj model
[quick start of Digital IC Verification] 19. Basic grammar of SystemVerilog learning 6 (thread internal communication... Including practical exercises)
LeetCode2_ Add two numbers
随机推荐
Shipping companies' AI products are mature, standardized and applied on a large scale. CIMC, the global leader in port and shipping AI / container AI, has built a benchmark for international shipping
C4D learning notes 1- animation - animation key frames
JS array foreach source code parsing
[quick start of Digital IC Verification] 18. Basic grammar of SystemVerilog learning 5 (concurrent threads... Including practical exercises)
U3D_ Infinite Bessel curve
webgl_ Graphic transformation (rotation, translation, zoom)
Three. JS introductory learning notes 15: threejs frame animation module
When opening the system window under UE4 shipping, the problem of crash is attached with the plug-in download address
Async and await
招标公告:福建省农村信用社联合社数据库审计系统采购项目(重新招标)
Three. JS introductory learning notes 05: external model import -c4d into JSON file for web pages
How to deploy the super signature distribution platform system?
2022第四届中国(济南)国际智慧养老产业展览会,山东老博会
【微信小程序】Chapter(5):微信小程序基础API接口
Ue4/ue5 multi thread development attachment plug-in download address
[Lanzhou University] information sharing of postgraduate entrance examination and re examination
Spin animation of Cocos performance optimization
深度之眼(六)——矩阵的逆(附:logistic模型一些想法)
The rebound problem of using Scrollview in cocos Creator
Three. JS introductory learning notes 04: external model import - no material obj model