Nagios: Service dependency on same host for an entire hostgroup

nagios

I have a Nagios system with a large number of hosts categorised in different hostgroups. Each of these hosts has two services monitored on it, one of which is intended to be dependent on the other – if service1 is WARNING or CRITICAL, service2 on that server should not give an alert as well. service2 is intended more for statistic collection, while service1 is a simple availability check – as such, I always want service2 checking, but not alerting if service1 is reporting as down.

This is my services.cfg entry:

define servicedependency{
    hostgroup                       example-servers
    #host_name                       host1.example.com,host2.example.com
    service_description             service1
    dependent_service_description   service2
    execution_failure_criteria      n
    notification_failure_criteria   u,w,c,o
}

I have tried both specifying it via a hostgroup and as a list of individual servers. Ideally, I would do it for the entire hostgroup in one rather than have to constantly maintain a list.

However, this does not seem to work, either way. If service1 is down, service2 also shows a CRITICAL status in the problems screen and on host details.

Best Answer

From the Nagios manual for "execution_failure_criteria": "If you specify n (none) as an option, the execution dependency will never fail and checks of the dependent service will always be actively checked (if other conditions allow for it to be)."

Sounds like you should be using "u,c" instead (don't check if server1 is UNKNOWN or CRITICAL). Or perhaps "w,u,c" IF a WARNING state from service1 should also cause service2 not to execute.

Related Topic