service dependency problem - config check hangs

Terry td3201 at gmail.com
Tue Sep 8 17:39:57 CEST 2009


2009/9/7 Mathieu Gagné <mgagne at iweb.com>:
> On 9/7/09 2:09 PM, Terry wrote:
>>
>> 2009/9/7 Mathieu Gagné<mgagne at iweb.com>:
>>
>> I turned that off but no luck.  What's interesting is this dependency
>> works fine:
>>
>> define servicedependency{
>>         hostgroup_name                          webmonitor
>>         service_description                     port 80
>>         dependent_hostgroup_name                webmonitor
>>         dependent_service_description           http.*
>>         inherits_parent                         0
>>         execution_failure_criteria              w,u,c
>>         notification_failure_criteria           w,u,c
>>         }
>>
>> Is it the large number of dependencies at play here that's the problem?
>
> You are still using the same syntax and still have the same problem:
> Each service starting with "http" on ALL hosts in hostgroup "webmonitor"
> will depend on ALL "port 80" service on ALL hosts in hostgroup "webmonitor".
> See the problem here?
>
> If you have 800 hosts and 10 http services, this will result in (10*800)*800
> servicedependencies. (~6,400,000 servicedependencies)
>
> Obviously, Nagios will "hang" if you have that much servicedependencies.
>
>
> My patch covers same host servicedependencies with dependent *servicegroups*
> by using this syntax:
>
> define servicedependency{
>  service_description            NRPE
>  dependent_servicegroup_name    all-services-depending-on-nrpe
> }
>
>
> As you can see, you are currently mixing 2 syntax. They are both *totally
> different*, dealt by 2 totally different parts of the Nagios code and you
> can't mix them.
>
>
> So, with the example you gave me (the one for HTTP, which is a totally
> different example), you can do this which should work fine:
>
> define servicedependency {
>  hostgroup_name                    webmonitor
>  service_description               port 80
>  dependent_service_description     http.*
>  inherits_parent                   0
>  execution_failure_criteria        w,u,c
>  notification_failure_criteria     w,u,c
> }
>
> The syntax is explained here:
> http://nagios.sourceforge.net/docs/3_0/objecttricks.html#same_host_dependency
>
>
> If you want a "mass definition" of self host servicedependencies for your
> services depending on NRPE, you will have to either:
> - Use my patch as I explained it earlier. (please reread my example if
> needed), OR
> - Make sure all services depending on NRPE start with the same prefix "nrpe"
> and use the syntax described above.
>
> --
> Mathieu
>

Ok, I was confused by the 'required' parameters of the
servicedependency object.  I thought that one of dependent_host_name
or dependent_hostgroup_name was required.  Here's what I ended up
with:

define servicedependency{
        hostgroup_name                          windows,linux
        service_description                     nrpeclient
        dependent_service_description           .* - nrpe
        inherits_parent                         1
        execution_failure_criteria              n
        notification_failure_criteria           w,u,c
        }
define servicedependency{
        hostgroup_name                          webmonitor
        service_description                     port 80
        dependent_service_description           http.*
        inherits_parent                         1
        execution_failure_criteria              n
        notification_failure_criteria           w,u,c
        }

The config checks out and looking at the config.cgi it appears to be
fine.  I don't like my naming conventions but I can mess with that
later.  Here's the config.cgi output:

athena	automatic services - nrpe 	athena	nrpeclient 	Check Execution	  	
athena	automatic services - nrpe 	athena	nrpeclient 	Notification	
	Warning, Unknown, Critical
hades	http www.foobar.org 	hades	port 80 	Check Execution	  	
hades	http www.foobar.org 	hades	port 80 	Notification	  	Warning,
Unknown, Critical

What's a challenge for me, other than wrapping my head around the
logic, is having to specify the host_name or hostgroup_name
explicitly.  And maybe this is what your patch deals with directly but
I would rather say any host that has the matching service of 'http.*'
or '.* - nrpe'.

I really appreciate your patience and helping me understand this.
I've never messed with dependencies before but really need to moving
forward.

Thanks,
Terry

------------------------------------------------------------------------------
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
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list