1.背景:
server端:
172.16.59.197 ,172.16.59.98
agent 端:
hostname:dba-test-hzj02
IP:172.16.59.98
2.方式:
配置多个server,serveractive
3.实例
# more /usr/local/zabbix/etc/zabbix_agentd.conf
Hostname=dba-test-hzj02 #agent端主机名
Server=172.16.59.197 #允许172.16.59.197来抓取数据
Server=172.16.59.98 #允许172.16.59.98来抓取数据
ServerActive=172.16.59.197 #将监控数据发送到172.16.59.197
ServerActive=172.16.59.98 #将监控数据发送到172.16.59.98
ListenPort=10050
BufferSize=1024
StartAgents=10
DebugLevel=2
PidFile=/home/logs/zabbix/zabbix_agentd.pid
LogFile=/home/logs/zabbix/zabbix_agentd.log
LogFileSize=10
EnableRemoteCommands=1
UnsafeUserParameters=1
Include=/home/logs/zabbix/zabbix_command.conf
Timeout=30
4.问题
配置多个server端时,发现后增的server端不能从agent端抓取到数据,但是数据可以从agent端主动传输到zabbix_server端,检查server端日志,发现报错如下:
9438:20171012:182812.895 cannot send list of active checks to "172.16.59.98": host [dba-test-hzj02] not found
原因是:
1.后增的server端web页面上关于agent端的配置 Host name 与agent端中配置文件中的hostname不一致,改成一致 dba-test-hzj02
2.IP address要配成agent端的IP地址,不要用127.0.0.1或localhost代替,改成172.16.59.98