当前位置:网站首页>分步式監控平臺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
边栏推荐
- How to create Apple Developer personal account P8 certificate
- 2022第四届中国(济南)国际智慧养老产业展览会,山东老博会
- Points for attention in porting gd32 F4 series programs to gd32 F3 series
- Streaming end, server end, player end
- 无线传感器网络--ZigBee和6LoWPAN
- L'application à l'échelle de la normalisation mature des produits ai des compagnies maritimes, cimc, leader mondial de l'intelligence artificielle portuaire et maritime / intelligence artificielle des
- Clang compile link ffmpeg FAQ
- Use moviepy Editor clips videos and intercepts video clips in batches
- HPDC smart base Talent Development Summit essay
- Particle effect for ugui
猜你喜欢
Three. JS introductory learning notes 19: how to import FBX static model
A wave of open source notebooks is coming
Application example of infinite list [uigridview]
webgl_ Enter the three-dimensional world (1)
Ida Pro reverse tool finds the IP and port of the socket server
无线传感器网络--ZigBee和6LoWPAN
讲师征集令 | Apache SeaTunnel(Incubating) Meetup 分享嘉宾火热招募中!
Ue4/ue5 multi thread development attachment plug-in download address
How does geojson data merge the boundaries of regions?
LeetCode1_ Sum of two numbers
随机推荐
Syntaxhighlight highlights the right scroll bar
Cocos uses custom material to display problems
Cocos makes Scrollview to realize the effect of zooming in the middle and zooming out on both sides
Numpy -- data cleaning
星瑞格数据库入围“2021年度福建省信息技术应用创新典型解决方案”
一大波开源小抄来袭
Spin animation of Cocos performance optimization
numpy--疫情数据分析案例
10 schemes to ensure interface data security
Unity的三种单例模式(饿汉,懒汉,MonoBehaviour)
Three. JS introductory learning notes 07: external model import -c4d to JSON file for web pages -fbx import
Introduction to pyGame games
Apache Doris刚“毕业”:为什么应关注这种SQL数据仓库?
How to build your own super signature system (yunxiaoduo)?
There are many ways to realize the pause function in JS
nodejs package. JSON version number ^ and~
20th anniversary of agile: a failed uprising
Super signature principle (fully automated super signature) [Yun Xiaoduo]
[quick start of Digital IC Verification] 18. Basic grammar of SystemVerilog learning 5 (concurrent threads... Including practical exercises)
Use moviepy Editor clips videos and intercepts video clips in batches