网络发现规则及自动添加hosts

Posted metasequoia

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了网络发现规则及自动添加hosts相关的知识,希望对你有一定的参考价值。

Version: zabbix 3.0

一、配置网络发现规则

技术分享

Device uniqueness criteria:选择主机名作为唯一标识(Configuation Hosts中显示的NAME)

 

二、查看发现的主机(Monitoring->Discovery)

技术分享

ps: 显示(api-1)需要在/etc/hosts定义 172.16.0.116  api-1

 

三、自动添加Hosts(加入到对应组,links对应模板)

技术分享

技术分享

 技术分享

现在可以看到添加的主机(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网络发现没有这个要求)

 

以上是关于网络发现规则及自动添加hosts的主要内容,如果未能解决你的问题,请参考以下文章

个人拾忆知识是需要积累的

自动化运维工具之Zabbixzabbix发现_自动注册及web页面状态监控

zabbix 自动发现及自动添加主机

Zabbix实战之客户端自动发现

zabbix自动发现

zabbix监控自动发发现了监控主机,为啥在host里面看不到