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.