当前位置:网站首页>Zabbix 5.0 Monitoring Tutorial (2)
Zabbix 5.0 Monitoring Tutorial (2)
2022-08-03 00:04:00 【star】
目录
五、解决 zabbix-server View graphics garbled question
3.See if in the automatic discovery has found the new host
部署 zabbix 客户端
在 Zabbix 5.0版本
agent2 新版本采用 golang 语言开发的客户端,由于是go语言开发,Deploy rise very convenient,And before application deployment form different
agnet2 默认用10050端口,也就是zabbix客户端
·旧版本的客户端,zabbix-agent
·goLanguage version of the client,zabbix-agent2
IP | 操作系统 | 主机名 | 服务名 | |
服务端 | 192.168.78.131 | CentOS 7 | server02 | zabbix-server、zabbix-agent |
客户端 | 192.168.78.128 | CentOS 7 | client01 | |
客户端 | 192.168.78.132 | CentOS 7 | client02 |
一、环境初始化
可以看下面这篇文章
二、同步北京时间
yum install -y ntpdate
ntpdate -u ntp.aliyun.com
mv /etc/localtime{,.bak} # 备份
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
三、zabbix-agent2 部署流程
1.# 下载 zabbix yum 源
rpm -Uvh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
2.# 更换 zabbix.repo 为阿里源
sed -i 's#http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix#' /etc/yum.repos.d/zabbix.repo
3.# 安装 zabbix-agent2
yum -y install zabbix-agent2
4.# 启动 zabbix-agent2 并设置开机自启
systemctl enable --now zabbix-agent2.service
netstat -ntpl | grep zabbix
5.# 修改配置文件
vim /etc/zabbix/zabbix_agent2.conf
# Mandatory: yes, if StartAgents is not explicitly set to 0
# Default:
# Server=
Server=192.168.78.131 # 修改为服务端的ip
# Mandatory: no
# Default:
# ServerActive=
ServerActive=192.168.78.131 # 修改为服务端的ip
# Mandatory: no
# Default:
# Hostname=
Hostname=Zabbix-client01 # Is modified to the client host name
6.# 查看是否修改成功
[[email protected] ~]# grep -Ev '^#|^$' /etc/zabbix/zabbix_agent2.conf # 省去 #符 和空格
PidFile=/var/run/zabbix/zabbix_agent2.pid
LogFile=/var/log/zabbix/zabbix_agent2.log
LogFileSize=0
Server=192.168.78.131
ServerActive=192.168.78.131
Hostname=Zabbix-client01
Include=/etc/zabbix/zabbix_agent2.d/*.conf
ControlSocket=/tmp/agent.sock
7.# 重启 zabbix-agent2
systemctl restart zabbix-agent2.service
四、验证 zabbix-agent2 的连通性
1.# Active access to customer service in the server end data
[[email protected] ~]# yum install -y zabbix-get
2.# Command links on test server is the client
[[email protected] ~]# zabbix_get -s '192.168.78.132' -p 10050 -k 'agent.ping'
1
[[email protected] ~]# zabbix_get -s '192.168.78.132' -p 10050 -k 'system.hostname'
client02
五、解决 zabbix-server View graphics garbled question
# On the server install Chinese fonts
[[email protected] ~]# yum -y install wqy-microhei-fonts
# 复制字体
[[email protected] ~]# \cp /usr/share/fonts/wqy-microhei/wqy-microhei.ttc /usr/share/fonts/dejavu/DejaVuSans.ttf
恢复正常:
六、添加 zabbix-agent 主机
以下两种方法(自动发现、自动注册)Can automatically add client host:
自动发现
zabbixMonitoring and control system provides an efficient and flexible automated discovery function,This feature is very useful when large-scale deployment of monitoring.主要由serverEnd a discovery process,定时扫描.主要有以下优点:
- 加快Zabbix部署
- 简化管理
- 在快速变化的环境中使用Zabbix,无需过多管理
- 规则
Automatic discovery based on the following information
- 可用的外部服务(FTP、SSH、WEB、POP3、IMAP、TCP 等)
- 来自 Zabbix 客户端的信息(仅支持未加密模式)
- 来自 SNMP 客户端的信息
Automatic discovery includes two stages
1.发现
2.动作
1.创建自动发现规则
2.添加动作
Associated automatically discover rules
3.See if in the automatic discovery has found the new host
监测-自动发现
自动注册
Zabbix Active agent可以实现自动注册,Which server to monitor its.通过这种方式,无需在服务器上进行手动配置便可直接启动对新host的监控.Was sponsored by the client,并且需要安装agent服务.
In the current our own cloud application environment,I'm more inclined to use automatic registration.Automatic register rules:
- If the host metadata information change:
- 由于HostMetadataHas changed and the agent has to restart
- 由于HostMetadataItemThe return value is changed
- For the lack of metadata manually create host
- If manual will host changes for anotherZabbix代理监视
- If the same host automatically registered from newZabbix代理
1.配置动作
Select operation TAB
Associated with the following:
解释说明:
- 发送消息给administrators组
- 添加主机
- 关联到linux servers组
- 关联zabbix agent模版
The above if the match is successful,As the above process to complete automatic registration operation
After the completion of the created to ensure that the state as已启用
等待1-2分钟检查,Check has been added successfully:
边栏推荐
- Informatics Olympiad All-in-One (1259: [Example 9.3] Find the longest non-descending sequence)
- golang 刷leetcode:祖玛游戏
- 以赛促练-力扣第304场周赛反思(持续更新中)
- 汇编语言中b和bl关键字的区别
- Mysql用户管理
- Flink Yarn Per Job - 创建启动Dispatcher RM JobManager
- 管理工具|宝藏书签收藏管理工具
- 从零开始配置 vim(5)——本地设置与全局设置
- [21 Days Learning Challenge] Bubble Sort and Insertion Sort
- 什么是幂等
猜你喜欢
.NET performance optimization - you should set initial size for collection types
汉源高科千兆4光4电工业级网管型智能环网冗余以太网交换机防浪涌防雷导轨式安装
Informatics Olympiad All-in-One (1259: [Example 9.3] Find the longest non-descending sequence)
【3D视觉】realsense D435三维重建
Digital twins help visualize the construction of smart cities
Li Mu hands-on learning deep learning V2-bert and code implementation
包管理工具Chocolate - Win10如何安装Chocolate工具、快速上手、进阶用法
How to quickly compare two byte arrays for equality in .NET
Day35 LeetCode
汇编语言中b和bl关键字的区别
随机推荐
[C题目]力扣138. 复制带随机指针的链表
微软SQL服务器被黑客入侵以窃取代理服务的带宽
STP生成树协议
vscode如何能将输出从OUTPUT改为TERMINAL或者DebugConsole
golang 刷leetcode:统计打字方案数
【流媒体】推流与拉流简介
C# Barrier类
华为设备配置BFD多跳检测
典型相关分析CCA计算过程
【目标检测】YOLOv5:640与1280分辨率效果对比
X 2 Earn必须依靠旁氏启动?GameFi的出路在哪?(下)
ACE JET NPOI
【3D视觉】深度摄像头与3D重建
YOLOv5+BiSeNet——同时进行目标检测和语义分割
[C题目]力扣142. 环形链表 II
Li Mu hands-on deep learning V2-BERT pre-training and code implementation
56.【全局变量和局部变量专题】
Day35 LeetCode
js how to get the browser zoom ratio
信息学奥赛一本通(1259:【例9.3】求最长不下降序列)