zabbix-agent安装
环境:
OS:Centos 7
zabbix:4.0.5
1.将基础镜像修改为阿里云的
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all
2.生成zabbix yum文件
rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
3.安装zabbix-agent
yum install -y zabbix-agent
4.启动
systemctl start zabbix-agent
systemctl status zabbix-agent
5.修改配置文件
/etc/zabbix/zabbix_agentd.conf
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=1
DebugLevel=3
SourceIP=192.168.1.135
EnableRemoteCommands=1
LogRemoteCommands=1
Server=192.168.1.136
ListenPort=10050
ListenIP=192.168.1.135
StartAgents=3
ServerActive=192.168.1.136
Hostname=host135
HostnameItem=system.hostname
RefreshActiveChecks=120
BufferSend=20
BufferSize=100
MaxLinesPerSecond=20
Timeout=3
AllowRoot=1
Include=/etc/zabbix/zabbix_agentd.d/*.conf
UnsafeUserParameters=1
红色标注为关键参数
6.重启
systemctl restart zabbix-agent
7.zabbix服务端创建自动发现(好像不管用)
配置自动发现的动作,注意状态必须为“启用”
8.也可以手工添加添加
遇到的问题1:
6403:20241219:151625.422 server #7 started [preprocessing worker #1]
6404:20241219:151625.423 server #8 started [preprocessing worker #2]
6434:20241219:151805.266 cannot send list of active checks to "192.168.1.135": host [host135] not found
6434:20241219:152005.324 cannot send list of active checks to "192.168.1.135": host [host135] not found
6439:20241219:152138.214 cannot send list of active checks to "192.168.1.135": host [host135] not found
6434:20241219:152338.268 cannot send list of active checks to "192.168.1.135": host [host135] not found
解决办法:需要添加主机的时候,在模板栏目加上对应链接指示器
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?