service dependency problem - config check hangs
Mathieu Gagné
mgagne at iweb.com
Mon Sep 7 20:40:21 CEST 2009
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
------------------------------------------------------------------------------
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