为了到达customer-es-prd-dobb1,数据包必须通过主机“cust-client-vpn”遍历(基于客户端的)vpn。 中间主机有一个名为“customer-prod-vpn”的检查来监视特定连接的健康状况。
目标是使客户networking中的主机服务都依赖于中介机上的特定服务。 我但是得到
Error: Could not expand dependent services specified in service dependency (config file '/usr/local/nagios/etc/conf.d/servicedependency/customer.cfg', starting on line 1) Error processing object config files!
如果我用例如“cpu usage”(一个现有的检查)replace通配符,它将起作用。
这里是相关的依赖块:
define servicedependency { dependent_host_name customer-es-prd-dobb1 dependent_service_description * host_name cust-client-vpn service_description customer-prod-vpn execution_failure_criteria w,u,c notification_failure_criteria w,u,c }
中介主机configuration:
define host { host_name cust-client-vpn alias cust-client-vpn address ip_addr_was_here use nrpe-server,host-pnp hostgroups debian-servers, monit-servers _NRPESSL -n contacts operations }
中介主机检查一切依赖
define service { use generic-service,srv-pnp host_name cust-client-vpn service_description customer-prod-vpn check_command check_nrpe_1arg!check_customer_vpn_prod check_interval 10 max_check_attempts 1 }
最后是在nagios中“customer-prod-vpn”检查的状态:
customer-prod-vpn OK 05-20-2013 16:21:15 0d 14h 50m 42s 1/1 OK - UP
任何nagios忍者在那里指出是什么问题?
“ '只是不使用正则expression式(use_regexp_matching = 0)时有效的通配符。 正则expression式中的通配符是至less。
我去了。*和use_regexp_matching = 1
看看节省时间的技巧文档页面…使用通配符的描述似乎表明,你的方式应该工作,虽然他们没有明确地有你正在做什么的例子。
鉴于你的方式不工作,我知道这样做的唯一方法是使用服务组。
将该主机上的所有服务放入一个服务组(可能使用模板或通配符?),并将该服务组用作依赖关系。 这绝对有效。 我这样做。