5

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.

jreid9001
  • 161
  • 2
  • 6

2 Answers2

0

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.

Jim Black
  • 266
  • 2
  • 12
  • I'd like the check to be made in any case (for performance data), but only to send notifications if service1 is not warning/critical. – jreid9001 Mar 11 '13 at 10:03
0

If you specify "execution_failure_criteria n" then service2 will always be checked. If is is checked and is in a warning or critical state the user interface will show that state. You can't prevent that (afaik), but you can prevent it sending notifications, e.g "notification_failure_criteria u,w,c".

I think you can either have "execution_failure_criteria" set as it is (i.e. "n"), and live with the status showing service2 as critical when it can't be reached, or change it to "c".

You probably don't want to suppress notifications if service1 is OK, which is what you are doing with the "o" in "notification_failure_criteria u,w,c,o".

John Ball
  • 501
  • 4
  • 3