NRPE dependencies

John P. Rouillard rouilj at cs.umb.edu
Tue Sep 26 00:04:05 CEST 2006


In message <ef9cmi$kmu$1 at sea.gmane.org>,
Ugo Bellavance writes:
>Hendrik Baecker wrote:
>> Hi,
>> 
>> just do so... the services dependency feature is just there for such an 
>> installation.
>> 
>> Read more about it on:
>> 
>> http://nagios.sourceforge.net/docs/2_0/xodtemplate.html#servicedependency
>
>Ok, it works.  Maybe I went too quickly.
>
>What dit not work is that I would like to use a group for the service 
>description.
>
>I want to be able to say that for every server in my config, if NRPE is 
>not returning OK on one server, don't do checks that depend on NRPE.
>
>The ideal solution would be only one servicedependency definition, but I 
>don't think it is possible, so here is what I tried:
>
>- Defined a servicegroup:
>
>define servicegroup{
>         servicegroup_name               NRPE_dep
>         alias                           NRPE-dependant checks
>	}
>
>- I added members through the "servicegroups" directive in the service 
>descriptions.
>
>Now I'm trying that:
>
>define servicedependency{
>         dependent_servicegroup_name     NRPE_dep
>         host_name                       server1
>         service_description             NRPE
>         execution_failure_criteria      n
>         notification_failure_criteria   w,u,c
>         }
>
>I always get this error:
>
>Error: NULL service description/host name in service dependency definition

Apply the patch mentioned in:

 http://thread.gmane.org/gmane.network.nagios.user/19511/focus=19511

and see if:


define servicedependency {

        use                             defaults
        dependent_servicegroup_name     NRPE_dep

        service_description             NRPE
        host_name                       SELF

}

Don't know it it will work, but it seems like it should from the 
description.


Alternatively do what I do. Create a servicedependency.cfg file that
is created by a script that parses the objects.cache file. so to
update:

  clear/empty servicedependency.cfg

  reload nagios

  wait until objects.cache is updated

  parse objects.cache for all the host/service pairs in the NRPE_dep
        servicegroup

  generate:
    define servicedependency{
      dependent_host_name example
      dependent_service_description (all services from NRPE_dep
                                       for host example)
      host_name example
      service_description NRPE
     ...
    }
  and put them into servicedependency.cfg 

  reload nagios to load the now non-empty servicedependency.cfg file.


Definitely a pain.

				-- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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