About dependencies


#1

Hello,

I would like to configure service dependencies on nagios.
For example, when the ping is critical on host a, i don’t want any notifications or check for other services on this host. I have made that with this configuration :

define servicedependency {

host_name hosta
service_description ping
dependent_host_name hosta
dependent_service_description Cpu
execution_failure_criteria c
notification_failure_criteria c
}

First , i would like to know if i must configure this for each services on each host?

Second, i would like to know if it is implicit ?
When the test “check_alive” in the definition of the host is processed. If the checck_alive return unreachable, notification and check for other services on this host are also processed ??

Sorry for my bad english
Thanks in advance


#2

Hello Powah,

Welcome to the forums… when you define a service dependency for a service, it will only apply to that service for which you have set the definition. In your case that would be “ping”. But if you wanted, you could easily add others to that service dependency definition. Here is an example, say you have the following services that you want to add to your definition: ping, ssh, and htttp. Your code would look like:

I am not totally sure what you mean in your second paragraph, do you mean whether or not the other processes in your other service definitions will be processed?


#3

good news: YES, it is!

in fact, when a host is detected as “DOWN”, the notifications for its services won’t be sent until the host returns to UP.

Which means: you don’t have to define any dependancies in your cast! isn’t that a great news ? :slight_smile:

--------OPTIONNAL------
Note: it might not be clear; so don’t try to understand if you don’t care :slight_smile:
BUT, you should know something: Nagios has a “weird” (but logical) mechanic when this happens: (in v1.2 to 2.10, and probably in v3.0-haven’t tested it yet):
When a service goes down, nagios does a host check for its host. If it is found DOWN, nagios will send a HOST DOWN notification and no service DOWN notification. Up until now, everything is fine.
But then, in order to lighten the load, Nagios will not do any more host checks! it will simply test the services. As long as no services are up, it will keep on sending HOST DOWN notifications…
Which means that, if your host goes UP BUT your services do not, it will keep on sending HOST DOWN notifications, even if the host is UP …
We have often the case when we have only 1 or 2 services on a host…

that’s a bit of a problem, so, in the end, we try to avoid this mechanic just because of that


#4

In first, thanks.

geofoxer, is it possible to do that :
dependent_service_description Cpu , Load…
ie, few services are dependent to one service.
I mean, if the ping doesn’t work no checks and no notifications about other services on the same host. ?

loose, you said : it will simply test the services.
It means , there is no notifications but there is a lots of checks.
If i configure service dependencies like that :
define servicedependency {

host_name hosta
service_description ping
dependent_host_name hosta
dependent_service_description Cpu
execution_failure_criteria c
notification_failure_criteria c
}

there is no checks , it is better, not ??

thanks


#5

I would think so, go ahead and give it shot if you want and see if you get any errors. If not, then I was wrong in my anticipations!!! :wink:


#6

yes, I said that :slight_smile:
So yes, it is a lot of checks … but no more than when everything is working, after all :slight_smile:

So, if your server is able to handle all the checks when everything is working, it won’t really matter if nagios will keep on testing :slight_smile:

But, if you need to know: yes, your config should work as intended.