当前位置:网站首页>分步式監控平臺zabbix
分步式監控平臺zabbix
2022-07-07 15:57: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
边栏推荐
- [excelexport], Excel to Lua, JSON, XML development tool
- Postman generate timestamp, future timestamp
- Getting started with webgl (2)
- Summary of knowledge points of xlua hot update solution
- TS as a general cache method
- Please supervise the 2022 plan
- 有钱人买房就是不一样
- Align individual elements to the right under flex layout
- Three. JS introductory learning notes 00: coordinate system, camera (temporarily understood)
- XMIND frame drawing tool
猜你喜欢
The unity vector rotates at a point
SPI master RX time out interrupt
Super simple and fully automated generation super signature system (cloud Xiaoduo minclouds.com cloud service instance), free application in-house test app distribution and hosting platform, maintenan
Unity3D_ Class fishing project, bullet rebound effect is achieved
深度之眼(七)——矩阵的初等变换(附:数模一些模型的解释)
C4D learning notes 1- animation - animation key frames
Three. JS introductory learning notes 19: how to import FBX static model
Actually changed from 408 to self proposition! 211 North China Electric Power University (Beijing)
融云斩获 2022 中国信创数字化办公门户卓越产品奖!
Numpy -- epidemic data analysis case
随机推荐
Getting started with webgl (2)
喜讯!科蓝SUNDB数据库与鸿数科技隐私数据保护管理软件完成兼容性适配
Three. JS introductory learning notes 10:three JS grid
The unity vector rotates at a point
过度依赖补助,大客户收款难,冲刺“国产数据库第一股”的达梦后劲有多足?
一大波开源小抄来袭
nodejs package. JSON version number ^ and~
尤雨溪,来了!
Ida Pro reverse tool finds the IP and port of the socket server
Super simple and fully automated generation super signature system (cloud Xiaoduo minclouds.com cloud service instance), free application in-house test app distribution and hosting platform, maintenan
The significance of XOR in embedded C language
Three. JS introductory learning notes 07: external model import -c4d to JSON file for web pages -fbx import
When opening the system window under UE4 shipping, the problem of crash is attached with the plug-in download address
Apache Doris刚“毕业”:为什么应关注这种SQL数据仓库?
[Lanzhou University] information sharing of postgraduate entrance examination and re examination
Write sequence frame animation with shader
C4D learning notes 2- animation - timeline and time function
TS typescript type declaration special declaration field number is handled when the key key
How to understand that binary complement represents negative numbers
Three. Introduction to JS learning notes 17: mouse control of 3D model rotation of JSON file