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
解决办法:需要添加主机的时候,在模板栏目加上对应链接指示器