Mass define servicedependency for NRPE services

Mathieu Gagné mgagne at iweb.com
Thu Sep 3 03:46:53 CEST 2009


Hi,

On 9/2/09 9:28 PM, Thomas Guyot-Sionnest wrote:
>
> In the patch I'm talking about you would still need a host_name or
> hostgroup_name directive - usually the same one that is defined on any
> of your NRPE service definition. I don't see why you would want to take
> it out either...
>
> i.e.:
>
> define service {
>    hostgroup_name                  linux-servers
>    service_description             NRPE
>    blah blah blah...
> }
>
> define service {
>    hostgroup_name                  linux-servers
>    service_description             Load
>    servicegroups                   nrpe-services
>    blah blah blah...
> }
>
> define servicedependency {
>    hostgroup_name                  linux-servers
>    service_description             NRPE
>    dependent_servicegroup_name     nrpe-services
>    execution_failure_criteria      n
>    notification_failure_criteria   c,u
> }
>
> Then on each host, "Load" (and any other service in nrpe-services)
> becomes dependent of NRPE on the same host. Is that working?

I don't see any patch. I tried what you suggested with Nagios 3.0 and 
all NRPE based services are now depending on all NRPE services on ALL 
hosts. (ie. "Load" on host "hostA" would depends on "NRPE" on "hostA", 
"hostB", "hostC", etc.)

You should try it and see the result on this page:
/nagios/cgi-bin/config.cgi?type=servicedependencies

I already tried all combination before asking the mailinglist and 
writing the patch.

I also don't see the need to include a "host_name" or "hostgroup_name" 
directive for this purpose. The host the service is running on is 
already available in the service definition itself expanded from the 
"dependent_servicegroup_name" directive.

--
Mathieu

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july




More information about the Developers mailing list