当前位置:网站首页>分步式监控平台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


边栏推荐
- Use of SVN
- Getting started with webgl (3)
- The "go to definition" in VS2010 does not respond or prompts the solution of "symbol not found"
- Spin animation of Cocos performance optimization
- Ue4/ue5 multi thread development attachment plug-in download address
- [original] all management without assessment is nonsense!
- The unity vector rotates at a point
- 【微信小程序】Chapter(5):微信小程序基础API接口
- [quickstart to Digital IC Validation] 20. Basic syntax for system verilog Learning 7 (Coverage Driven... Including practical exercises)
- Three. JS introductory learning notes 07: external model import -c4d to JSON file for web pages -fbx import
猜你喜欢

15. Using the text editing tool VIM

C4D learning notes 2- animation - timeline and time function
![[quick start of Digital IC Verification] 25. AHB sramc of SystemVerilog project practice (5) (AHB key review, key points refining)](/img/78/29eb8581e9a8fb4c6c7e1e35ad7adc.png)
[quick start of Digital IC Verification] 25. AHB sramc of SystemVerilog project practice (5) (AHB key review, key points refining)

Dotween -- ease function

讲师征集令 | Apache SeaTunnel(Incubating) Meetup 分享嘉宾火热招募中!

Three. JS introductory learning notes 19: how to import FBX static model
![[quick start of Digital IC Verification] 18. Basic grammar of SystemVerilog learning 5 (concurrent threads... Including practical exercises)](/img/91/16a370ac41adc8fe31507765a82b0a.png)
[quick start of Digital IC Verification] 18. Basic grammar of SystemVerilog learning 5 (concurrent threads... Including practical exercises)

SPI master rx time out中断

When opening the system window under UE4 shipping, the problem of crash is attached with the plug-in download address

Three. JS introductory learning notes 08:orbitcontrols JS plug-in - mouse control model rotation, zoom in, zoom out, translation, etc
随机推荐
Introduction to pyGame games
Iterator and for of.. loop
深度之眼(七)——矩阵的初等变换(附:数模一些模型的解释)
webgl_ Enter the three-dimensional world (2)
[Lanzhou University] information sharing of postgraduate entrance examination and re examination
Function: JS Click to copy content function
Three. JS introductory learning notes 00: coordinate system, camera (temporarily understood)
[quick start of Digital IC Verification] 23. AHB sramc of SystemVerilog project practice (3) (basic points of AHB protocol)
用手机在通达信上开户靠谱吗?这样炒股有没有什么安全隐患
Three. JS introductory learning notes 0: illustration of how webgl and threejs work
The "go to definition" in VS2010 does not respond or prompts the solution of "symbol not found"
讲师征集令 | Apache SeaTunnel(Incubating) Meetup 分享嘉宾火热招募中!
融云斩获 2022 中国信创数字化办公门户卓越产品奖!
TS typescript type declaration special declaration field number is handled when the key key
Please supervise the 2022 plan
[quick start of Digital IC Verification] 19. Basic grammar of SystemVerilog learning 6 (thread internal communication... Including practical exercises)
Annexb and avcc are two methods of data segmentation in decoding
The rebound problem of using Scrollview in cocos Creator
Three. JS introductory learning notes 04: external model import - no material obj model
Mesh merging under ue4/ue5 runtime