Version: zabbix 3.0
一、配置网络发现规则(Configuration Discovery)
Device uniqueness criteria:选择主机名作为唯一标识(Configuation Hosts中显示的NAME)
二、查看发现的主机(Monitoring->Discovery)
ps: 显示主机名(m-proxy1)需要在服务器端/etc/hosts定义
192.168.0.2 m-proxy1
三、自动添加Hosts(加入到对应组,links对应模板)(Configuration -> Actions Event -> Discovery)
现在可以看到添加的主机(Configuation->Hosts)
Q&S
步骤一后 并未发现hosts
Solve:
1 tcpdump -vnn host 172.16.0.116 and port 10050 #发现服务器并没有发送discovery包到客户端
2 日志开启 debugging (DebugLevel=5)
tail -f /tmp/zabbix_server.log | grep discover
9983:20160312:174909.385 __zbx_zbx_setproctitle() title:'discoverer #1 [processed 1 rules in 0.020067 sec, performing discovery]' 9983:20160312:174909.393 In discover_service() 9983:20160312:174909.394 discovery: item [system.uname] error: A TLS connection is configured to be used with agent but support for TLS was not compiled into server. 9983:20160312:174909.394 End of discover_service():FAIL 9983:20160312:174909.394 In discovery_update_service() ip:'172.16.0.115' dns:'' port:10050 status:1 value:'' 9983:20160312:174909.395 In discovery_register_host() ip:'172.16.0.115' status:1 value:'' 9983:20160312:174909.395 End of discovery_register_host() 9983:20160312:174909.395 End of discovery_update_service() 9983:20160312:174909.396 In discovery_update_host() 9983:20160312:174909.397 End of discovery_update_host() 9983:20160312:174909.397 In discovery_clean_services() 9983:20160312:174909.397 End of discovery_clean_services() 9983:20160312:174909.400 __zbx_zbx_setproctitle() title:'discoverer #1 [processed 1 rules in 0.014707 sec, idle 30 sec]' 9965:20160312:174923.275 query [txnlev:0] [select refresh_unsupported,discovery_groupid,snmptrap_logging,severity_name_0,severity_name_1,severity_name_2,severity_name_3,severity_name_4,severity_name_5,hk_events_mode,hk_events_trigger,hk_events_internal,hk_events_discovery,hk_events_autoreg,hk_services_mode,hk_services,hk_audit_mode,hk_audit,hk_sessions_mode,hk_sessions,hk_history_mode,hk_history_global,hk_history,hk_trends_mode,hk_trends_global,hk_trends,default_inventory_mode from config] 9967:20160312:174935.465 In substitute_key_macros() data:'zabbix[process,discoverer,avg,busy]' 9967:20160312:174935.465 End of substitute_key_macros():SUCCEED data:'zabbix[process,discoverer,avg,busy]' 9967:20160312:174935.465 In get_value() key:'zabbix[process,discoverer,avg,busy]' 9985:20160312:174935.671 In evaluate_function() function:'Zabbix server:zabbix[process,discoverer,avg,busy].avg(10m)' 9983:20160312:174939.404 __zbx_zbx_setproctitle() title:'discoverer #1 [processed 1 rules in 0.014707 sec, performing discovery]' 9983:20160312:174939.413 In discover_service() 9983:20160312:174939.413 discovery: item [system.uname] error: A TLS connection is configured to be used with agent but support for TLS was not compiled into server. 9983:20160312:174939.413 End of discover_service():FAIL
需要TLS支持(yum install -y openssl openssl-devel) configure --with-openssl
(2.0网络发现没有这个要求)