Service-Parent? Dependencies between nrpe agents and it's checks

John P. Rouillard rouilj at cs.umb.edu
Thu Oct 20 19:44:32 CEST 2005


In message <1129816562.26376.159.camel at chi101100.int.tt.local>,
jeff vier writes:
>On Thu, 2005-10-20 at 15:05 +0200, Karim Vaes wrote:
>> Is it possible to build a kind of system (that is maintainable) that
>> makes sure if a nrpe isn't reacable, that it acts as a kind of parent,
>> as is with hosts?
>
>Just put check_dummy on your nrpe-checked hosts and make it a
>servicedependency of the other nrpe checks.

What you are recommending is to use check_dummy to define a
"check_nrpe" service and then creating a ton of service dependencies
of the form:

  define servicedependency{
	dependent_host_name		MYHOST
	dependent_service_description	service_check_1_via_nrpe
	host_name			MYHOST
	service_description		check_nrpe
   	}

Repeat for all 20/30 service checks.  However I claim that's not very
maintainable. What is more maintainable is a way to do the following:

  define servicedependency{
	dependent_servicegroup_name	CHECKED_VIA_NRPE_GROUP
	host_name			=
	service_description		check_nrpe
   	}

Where the = sign says:

	use the same host as in the dependent service

So a dependent_service_group that consisted of:
      host1;svc1
      host2;svc1
      host2;svc2

would expand to the equivalent of:

  define servicedependency{
	  dependent_host_name		host1
	  dependent_service_description	svc1
	  host_name			host1
	  service_description		check_nrpe
	  }


  define servicedependency{
	  dependent_host_name		host2
	  dependent_service_description	svc1
	  host_name			host2
	  service_description		check_nrpe
	  }

  define servicedependency{
	  dependent_host_name		host2
	  dependent_service_description	svc2
	  host_name			host2
	  service_description		check_nrpe
	  }

Then when defining a (new) service, you just add the servicegroups
line in the service definition:

  define service {
    hostgroup_name	standard_host_checks
	...
    servicegroups 	CHECKED_VIA_NRPE_CROUP
  }

and you will automatically get the service dependencies set up.

This way I can add a new host to a hostgroup (standard_host_checks),
and it will immediately get all the NRPE tests and dependencies. No
other command file changes are needed. Just select the hostgroups the
host should belong to an viola. Makes it a LOT less error prone.

I am working on some C coding, but it is not easy going. I may craft
together a filepp based solution instead.

Note, the examples/pseudo examples above only work with nagios 2.0.

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


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
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