当前位置:网站首页>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:
边栏推荐
- golang刷leetcode:我能赢吗
- 回文自动机+CodeTON Round 2 C,D
- 【C语言进阶】--指针典题剖析
- golang刷letcode:公司命名
- 千人优学 | GBase 8s数据库2022年6月大学生专场实训圆满结束
- Xcode13.1运行工程报错fatal error: ‘IFlyMSC/IFly.h‘ file not found的问题
- The five classification of software testing
- How to quickly compare two byte arrays for equality in .NET
- 【3D视觉】深度摄像头与3D重建
- 人尽皆知的云原生,到底是大势所趋还是过度炒作?
猜你喜欢
随机推荐
PLC working principle animation
并发与并行
【流媒体】推流与拉流简介
sre成长之路
用了TCP协议,就一定不会丢包吗?
golang 刷leetcode:Morris 遍历
手把手教你干掉if else
【模型压缩】实例分析量化原理
The software testing process specification is what?Specific what to do?
56.【全局变量和局部变量专题】
HCIP--BGP基础实验
Day12 接口和协议
The Orsay in Informatics (1256: Bouquet for Algernon)
Swin Transformer 论文精读,并解析其模型结构
golang刷leetcode:按位与结果大于零的最长组合
vscode如何能将输出从OUTPUT改为TERMINAL或者DebugConsole
如何使用windbg查看C#某个线程的栈大小 ?
源码构建LAMP环境-3
Informatics Olympiad All-in-One (1260: [Example 9.4] Intercepting Missiles (Noip1999))
模糊查询like用法实例(Bee)