Re: [Nagios-devel] Service dependencies

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] Service dependencies

Post by Guest »

This is a multi-part message in MIME format.

------=_NextPart_000_0011_01C6F3E3.8C183400
Content-Type: multipart/mixed;
boundary="----=_NextPart_001_0012_01C6F3E3.8C183400"


------=_NextPart_001_0012_01C6F3E3.8C183400
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

Alright! I found out I'm not that bad in C and made my own patch. :)

What it does:

When Nagios duplicate servicedependency definitions, it checks for any
missing required variables. When it checks for empty host_name entry,
instead of returning an error I set a flag and fill-up the master_hostslist
using the dependent_host_name entry instead.

Later in the "duplication" loop, if the flag is present I don't duplicate
any definition that doesn't have the same hostname for master and dependent
host.

How to use it:

Just omit the "host_name" entry in a servicedependency definition ex:.

define servicedependency {
service_description Master service
dependent_hostgroup_name pool1,pool2
dependent_service_description Slave 1,Slave 2,Slave 3
notification_failure_criteria c,u
}

WARNING: This patch is EXPERIMENTAL. It was only tested with the expected
configuration. I DID NOT TEST ANY NORMAL CONFIGURATION; NEITHER DID I TEST
CONFIGURATION ERROR HANDLING. I'll review and test this patch thoughtfully
as soon as I get some spare time.

Please send me any bugs/comments you have on this patch...

Thomas

> -----Original Message-----
> From: william(at)elan.net [mailto:[email protected]]
> Sent: Thursday, October 19, 2006 22:42
> To: Thomas Guyot-Sionnest
> Cc: Tobias Mucke; Nagios-Devel
> Subject: Re: [Nagios-devel] Service dependencies
>
>
> On Thu, 19 Oct 2006, Thomas Guyot-Sionnest wrote:
>
> > I guess you mean setting it up in the service definition? But you'll
> have to
> > define which host here as well. So is't excatly the same as the
> > servicedependency definition.
> >
> > Actually I'm just thinking there could be another way. What if by
> omiting
> > one of the host_name / hostgroup_name variable, instead of failling
> check it
> > would turn the "same host" mode.
> >
> > define servicedependency {
> > service_description Master service
> > dependent_hostgroup_name pool1,pool2
> > dependent_service_description Slave 1,Slave 2,Slave 3
> > same_host_dependency 1
> > notification_failure_criteria c,u
> > }
>
> Interestingly enough I made a patch (for 2.2 & 2.3) that does almost
> exactly that. But I did not do it cleanly as I did not add new option
> and changed the behavior so that:
>
> define servicedependency {
> hostgroup_name group1
> servicegroup_name master_servicegroup
> dependent_servicegroup_name slavegroup1,slavegroup2
> notification_failure_criteria c,u
> execution_failure_critieria n
> }
>
> would add dependency for each host in hostgroup from services in master
> group to all services in slave groups.
>
> > There is no host_name defined for "Master service", so for each host in
> > "dependent_hostgroup_name" it creates a dependency to "Master service"
> on
> > the same host.
> >
> > Does it makes sense?
> >
> > Thomas
> >
> >> -----Original Message-----
> >> From: [email protected]
> >> [mailto:[email protected]] On Behalf
> >> Of Tobias Mucke
> >> Sent: October 19, 2006 11:31
> >> To: Nagios-Devel
> >> Subject: Re: [Nagios-devel] Service dependencies
> >>
> >> Hi,
> >>
> >> since we are using Nagios in a large environment here, we
> >> also have to fight with service dependencies and the approach
> >> how to configure it. What I would like to see in Nagios is
> >> the possibility to define that a service always depends on
> >> another service without even mentioning a host or hostgroup.
> >> Look at the example.
> >>
> >> I have a service called disk_os which checks all filesystems
> >> of a system or even a large group of systems. I do this by
> >> using nrpe. To check if nrpe is running I have a service
> >> called nrpe. Today I have to configure for every host with
> >> disk_os a single servicedepe

...[email truncated]...


This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked