We have an array of servers, any of which could go down generating a medium-priority notification:
define host {
host_name foo1
contacts medium-priority
use default-host
}
...
However, we'd like a higher-priority notification whenever more than two such servers are in trouble. To that end, we've set up a separate service-definition using Nagios'/Icinga's check_cluster
-utility:
define service {
service_description foo-cluster
servicegroups cluster-checks
display_name Foo Cluster
check_command check_cluster_host!Foo Cluster!0!3!$HOSTSTATEID:foo1$,$HOSTSTATEID:foo2,...$HOSTSTATEID:fooN$
contacts high-priority
hostgroup_name clusters
notes Check, that no more than 2 hosts in group foo are in trouble
use default-service
}
The above will probably work, but I'd like for this service-check to be triggered not by time, but only by a change in the status of any of the "underlying" hosts...
We generate Icinga's config-files with Ansible and so can construct complex dependencies programmatically -- but can such triggering be implemented at all?