Mass define servicedependency for NRPE services

Mathieu Gagné mgagne at iweb.com
Wed Sep 2 23:40:20 CEST 2009


On 9/2/09 8:57 AM, Thomas Guyot-Sionnest wrote:
>
> Mathieu Gagné wrote:
>> Hi,
>>
>> Thomas Guyot-Sionnest wrote:
>>> Just add the host_name or hostgroup_name directive (you can put all
>>> hostgroups for instance, or enable wildcards and use *) and you're set.
>>
>> Unfortunately, it doesn't work. This explains why I asked the
>> mailinglist. If I do as you suggested, all NRPE based services will be
>> depending on the NRPE service on ALL hosts. (not only their respective host)
>>
>> Here is my servicedependency definition:
>>
>> define servicedependency {
>>     hostgroup_name                  hosts-with-nrpe
>>     service_description             NRPE
>>     dependent_servicegroup_name     nrpe-services
>>     execution_failure_criteria      n
>>     notification_failure_criteria   c,u
>> }
>
> And what result you get with that? I have pretty much the same, but with
> a "dependent_service_name" directive, and it should do the same. If it
> don't, it's a bug.

So I guess it's a bug or it wasn't initially planned to work that way.
You will find attached to this message a patch against Nagios 3.0.6 that 
should fix this bug.

This servicedependency definition should now work:

define servicedependency {
   service_description             NRPE
   dependent_servicegroup_name     nrpe-services
   execution_failure_criteria      n
   notification_failure_criteria   c,u
}

You shouldn't get those errors anymore at startup:

Error: NULL master service description/host name in service dependency 
definition
Error: Could not register service execution dependency (config file 
'/etc/nagios3/XXXXX.cfg', starting on line YY)

For all services found in servicegroup "nrpe-services", a 
servicedependency against the NRPE service of their respective host 
should now be defined for each of them.

Any opinion about it? Is it the proper way to do it?

--
Mathieu
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: nagios-same-host-servicedependencies-with-servicegroups.patch
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20090902/0b28daa8/attachment.ksh>
-------------- next part --------------
------------------------------------------------------------------------------
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
-------------- next part --------------
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list